mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07: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:
@@ -177,6 +177,10 @@ static char *conf(char *path, size_t len, char *name, int creat)
|
||||
} else
|
||||
strlcat(path, name, len);
|
||||
|
||||
/* fall back to static service unless edit/create */
|
||||
if (!creat && !fexist(path))
|
||||
paste(path, len, FINIT_RCSD, name);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user