diff --git a/README.md b/README.md index b2a29a6e..3120a84e 100644 --- a/README.md +++ b/README.md @@ -214,13 +214,13 @@ the `/path/to/cmd` should be executed with. Simply prefix the path with run [2345] @joe:users /usr/bin/logger "Hello world" For multiple instances of the same command, e.g. a DHCP client or -multiple web servers, add `#ID` somewhere between the `run`, `task`, +multiple web servers, add `:ID` somewhere between the `run`, `task`, `service` keyword and the command, like this: - service #1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server - service #2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server + service :1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server + service :2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server -Without the `#ID` to the service the latter will overwrite the former +Without the `:ID` to the service the latter will overwrite the former and only the old web server would be started and supervised. diff --git a/finit.conf b/finit.conf index 5c38e613..472b2e65 100644 --- a/finit.conf +++ b/finit.conf @@ -1,8 +1,5 @@ -# Sample finit.conf to demonstatre the syntax +# Sample finit.conf to demonstrate the syntax # -# Comments are lines that start with #, comments are only allowed -# on separate lines. The # sign is used inside service/run/task -# stanzas to denote instance ID, see below. user admin host testbed @@ -46,8 +43,8 @@ inetd time/tcp nowait [2345] internal -- UNIX rdate servic inetd ssh@eth0:222/tcp nowait [2345] /usr/sbin/sshd -i -- SSH service inetd ssh/tcp nowait [2345] /usr/sbin/sshd -i -- SSH service -# For multiple instances of the same service, add #ID somewhere between +# For multiple instances of the same service, add :ID somewhere between # the service/run/task keyword and the command. -service #1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server -service #2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server +service :1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server +service :2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server diff --git a/service.c b/service.c index 93045e6e..392679a6 100644 --- a/service.c +++ b/service.c @@ -506,13 +506,13 @@ void service_runlevel(int newlevel) * when changing runlevel. * * For multiple instances of the same command, e.g. multiple DHCP - * clients, the user may enter an optional ID, using the #ID syntax. + * clients, the user must enter an ID, using the :ID syntax. * - * service #1 /sbin/udhcpc -i eth1 - * service #2 /sbin/udhcpc -i eth2 + * service :1 /sbin/udhcpc -i eth1 + * service :2 /sbin/udhcpc -i eth2 * - * Without the #ID syntax Finit will overwrite the first service line - * with the contents of the second. The #ID must be [1,MAXINT]. + * Without the :ID syntax Finit will overwrite the first service line + * with the contents of the second. The :ID must be [1,MAXINT]. * * Returns: * POSIX OK(0) on success, or non-zero errno exit status on failure. @@ -558,7 +558,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] == '#') /* #ID */ + else if (cmd[0] == ':') /* :ID */ id = atoi(&cmd[1]); else break;