Refactor: Cleanup and expand client code to support <version|q|reload|debug>

Further refactoring of the client code.  Supported commands:

- debug:   Toggle PID 1 debug flag
- version: Show Finit version or custom header string
- reload:  Reload config files in /etc/finit.d/, same as SIGHUP

Also supported is the legacy 'init q' command, to reload config.

The 'status' command now supports an optiona '-v', either as an
argument to init itself, or as argument to the command.  When it
is given 'status' lists verbose information about all services.
Currently only the service arguments are listed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-06-07 12:11:07 +02:00
parent 811bd75eab
commit 2026486fda
9 changed files with 233 additions and 145 deletions
+4
View File
@@ -121,6 +121,10 @@ static void parse(void *UNUSED(arg), int fd, int UNUSED(events))
debug = !debug;
break;
case INIT_CMD_RELOAD:
reload_finit_d();
break;
case INIT_CMD_ACK:
_d("Client failed reading ACK.");
goto leave;