From 2b74fb0e939ee04fd01c6247c6188186dae9f7c0 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 14 Jul 2016 18:39:10 +0200 Subject: [PATCH] Minor cleanup and corrections for new terminology Signed-off-by: Joachim Nilsson --- TODO.md | 4 ---- service.c | 17 ++++++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index 44c65615..cfa802aa 100644 --- a/TODO.md +++ b/TODO.md @@ -22,10 +22,6 @@ General * Add `!` or `[wait ]` to service directive to let finit pause and wait for a pidfile before starting processes -- both at boot and when starting processes in a runlevel. -* Allow custom reload for processes like libreSwan's pluto - - service [2345] /sbin/pluto - * Allow process callbacks to be scripts. * Add support for a pipe/popen where we can listen for `STOP`, `START` and `RELOAD` on `STDOUT` from a script ... call it for example diff --git a/service.c b/service.c index a5137d91..5f911f24 100755 --- a/service.c +++ b/service.c @@ -420,10 +420,10 @@ void service_runlevel(int newlevel) * The @line can optionally start with a username, denoted by an @ * character. Like this: * - * service @username [!0-6,S] /path/to/daemon arg -- Description - * task @username [!0-6,S] /path/to/task arg -- Description - * run @username [!0-6,S] /path/to/cmd arg -- Description - * inetd tcp/ssh nowait [2345] @root:root /sbin/sshd -i -- Description + * service @username [!0-6,S] /path/to/daemon arg -- Description + * task @username [!0-6,S] /path/to/task arg -- Description + * run @username [!0-6,S] /path/to/cmd arg -- Description + * inetd tcp/ssh nowait [2345] @root:root /sbin/sshd -i -- Description * * If the username is left out the command is started as root. The [] * brackets denote the allowed runlevels, if left out the default for a @@ -440,10 +440,9 @@ void service_runlevel(int newlevel) * special case when a service is declared with means it does not * support SIGHUP but must be STOP/START'ed at system reconfiguration. * - * Supported service events are: GW, IFUP[:ifname], IFDN[:ifname], where - * the interface name (:ifname) is optional. Actully, the check with a - * service event declaration is string based, so 'IFUP:ppp' will match - * any of "IFUP:ppp0" or "IFUP:pppoe1" sent by the netlink.so plugin. + * Service conditions can be: svc/ for PID files, net//up + * and net//exists. The condition handling is further described + * doc/conditions.md. * * For multiple instances of the same command, e.g. multiple DHCP * clients, the user must enter an ID, using the :ID syntax. @@ -491,7 +490,7 @@ int service_register(int type, char *line, time_t mtime, char *username) username = &cmd[1]; else if (cmd[0] == '[') /* [runlevels] */ runlevels = &cmd[0]; - else if (cmd[0] == '<') /* <[!][ev][,ev..]> */ + else if (cmd[0] == '<') /* <[!][cond][,cond..]> */ cond = &cmd[1]; else if (cmd[0] == ':') /* :ID */ id = atoi(&cmd[1]);