mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
initctl: fall back to .conf in /etc/finit.d if not in available/
For commands like `initctl show foo`, initctl looks in the available/ subdirectory for `foo.conf`. This patch adds support for falling back to return `/etc/finit.d/foo.conf` if the service doesn't exist in the `/etc/finit.d/available/` subdirectory. Static services, outside of the `enabled/` handling, live in the base dirctory and this is what you expect from the tool. "Do what I mean" Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
a1e38a3e40
commit
b9d498e01c
1 file changed
+4
@@ -177,6 +177,10 @@ static char *conf(char *path, size_t len, char *name, int creat)
|
|||||||
} else
|
} else
|
||||||
strlcat(path, name, len);
|
strlcat(path, name, len);
|
||||||
|
|
||||||
|
/* fall back to static service unless edit/create */
|
||||||
|
if (!creat && !fexist(path))
|
||||||
|
paste(path, len, FINIT_RCSD, name);
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user