Also, added benefit, we don't get compiler warnings for ignoring the
return value of system(), which we don't care about in this case.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Allow scripts to take space separated arguments with quoting
- Simplify script-exists check, which already checks for leading /
- Unset current script on parse error
- Allow setting no timeout
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
These variables really belong in conf.c. Relocate and move external
decls. from finit.h -> conf.h to simplify linking of other programs.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the relocation of several functions, including inline functions,
from helpers to util, we no longer need to include log.h. Which is a
good thing, since any subsystem that needs logging should explicitly
include log.h
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The file helpers.c should strictly only be used for misc. helper
functions to the main Finit daemon. The functions moved in this
commit are generic enough to be used by any deamon or programs,
and for that we have util.c
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Prevent name clash with upcoming refactor and any confusion with
src/plugin.c functions with the same name.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This refactor should have been done years ago when we first introduced
the big state machine. The old functions service_runvel() and the oddly
named service_reload_dynamic() are actually state machine control fns,
so let relocate them.
Also in this commit, remove the global variable 'sm' and rename a few of
the critical functions to better names.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Historically we've kept these two apart, but their commonalities are far
more than what separates them.
This fixes a bug where ready:scripts were not called for sysv daemons,
and also opens up for adding support for a reload:script for both types.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit also switches the stdout/stderr log capture backend for all
notify:systemd services from the sysklogd project's logger tool to the
bundled logit tool.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
clang-tidy complained that parse_prio() always returned OK(0), turns out
it was right. This patch adds validation of the parsing.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit introduces a bare-bones replacement for libsystemd:
- Build .so file and add --with-libsystemd to configure
- Add capabilities support to test/src/serv.c
- Update tests to account for a Finit built w/o libsystemd support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>