chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2dddca4
)
service: drop rc. prefix on frugalware linux
author
Miklos Vajna
<vmiklos@frugalware.org>
Tue, 7 Dec 2010 21:51:21 +0000
(22:51 +0100)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Thu, 16 Dec 2010 13:22:21 +0000
(14:22 +0100)
src/service.c
patch
|
blob
|
history
diff --git
a/src/service.c
b/src/service.c
index 1f478f4386b4071daf845ad3e75bf886666ca8e6..620f2b307ab20e345c7b2db1a340442fec5a3af2 100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-247,6
+247,11
@@
static char *sysv_translate_name(const char *name) {
else if (startswith(name, "@"))
/* Drop Arch-style background prefix */
strcpy(stpcpy(r, name + 1), ".service");
else if (startswith(name, "@"))
/* Drop Arch-style background prefix */
strcpy(stpcpy(r, name + 1), ".service");
+#endif
+#ifdef TARGET_FRUGALWARE
+ else if (startswith(name, "rc."))
+ /* Drop Frugalware-style rc. prefix */
+ strcpy(stpcpy(r, name + 3), ".service");
#endif
else
/* Normal init scripts */
#endif
else
/* Normal init scripts */
@@
-887,6
+892,18
@@
static int service_load_sysv_name(Service *s, const char *name) {
free(path);
}
free(path);
}
+ if (r >= 0 && s->meta.load_state == UNIT_STUB) {
+ /* Try Frugalware style rc.xxx init scripts */
+
+ if (asprintf(&path, "%s/rc.%s", *p, name) < 0)
+ return -ENOMEM;
+
+ /* Drop .service suffix */
+ path[strlen(path)-8] = 0;
+ r = service_load_sysv_path(s, path);
+ free(path);
+ }
+
if (r < 0)
return r;
if (r < 0)
return r;