[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

s-s-d and manpage updates

Hi Everyone,

Some changes for your consideration.

diff -ur dpkg- dpkg-
--- dpkg-	2008-01-26 13:16:35.000000000 -0500
+++ dpkg-	2008-01-28 15:29:14.000000000 -0500
@@ -318,8 +318,8 @@
 "Matching options (at least one is required):\n"
 "  -p|--pidfile <pid-file>       pid file to check\n"
 "  -x|--exec <executable>        program to start/check if it is running\n"
-"  -n|--name <process-name>      stop processes with this name\n"
-"  -u|--user <username|uid>      stop processes owned by this user\n"
+"  -n|--name <process-name>      process name to check\n"
+"  -u|--user <username|uid>      process owner to check\n"
 "  -g|--group <group|gid>        run process as this group\n"
@@ -668,7 +668,7 @@
 		badusage("--start needs --exec or --startas");
 	if (mpidfile && pidfile == NULL)
-		badusage("--make-pidfile is only relevant with --pidfile");
+		badusage("--make-pidfile requires --pidfile");
 	if (background && !start)
 		badusage("--background is only relevant with --start");
@@ -936,7 +936,7 @@
 		start_argv_0_p = *pid_argv_p;
 	else {
 		/* Tests indicate that this never happens, since
-		 * kvm_getargv itselfe cuts of tailing stuff. This is
+		 * kvm_getargv itself cuts of tailing stuff. This is
 		 * not what the manpage says, however. */
 		strncpy(buf, *pid_argv_p, (end_argv_0_p - start_argv_0_p));
 		buf[(end_argv_0_p - start_argv_0_p) + 1] = '\0';

--- /usr/share/man/man8/start-stop-daemon.8.gz
+++ /tmp/startstop-daemon.8.gz.12569	2008-01-28 16:42:20.000000000 -0500
@@ -1,4 +1,4 @@
-.TH start\-stop\-daemon 8 "2008-01-20" "Debian Project" "dpkg utilities"
+.TH start\-stop\-daemon 8 "2008-01-28" "Debian Project" "dpkg utilities"
 start\-stop\-daemon \- start and stop system daemon programs
@@ -29,7 +29,7 @@
 .BR \-\-stop
 is specified. For daemons which have long-lived children
 which need to live through a
-.BR \-\-stop
+.BR \-\-stop ,
 you must specify a pidfile.
@@ -44,8 +44,8 @@
 If such a process does not exist, it starts an
 instance, using either the executable specified by
 .BR \-\-exec ,
-(or, if specified, by
-.BR \-\-startas ).
+or, if specified, by
+.BR \-\-startas .
 Any arguments given after
 .BR \-\-
 on the command line are passed unmodified to the program being
@@ -65,7 +65,7 @@
 .BR \-\-oknodo
 is specified). If
 .B \-\-retry
-is specified then
+is specified, then
 .B start\-stop\-daemon
 will check that the process(es) have terminated.
@@ -120,7 +120,7 @@
 .I timeout
 is specified instead of
-.I schedule
+.IR schedule ,
 then the schedule
 .IB signal / timeout /KILL/ timeout
 is used, where
@@ -178,6 +178,7 @@
 .BR : ,
 then the group or gid in the same way
 as you would for the `chown' command (\fIuser\fP\fB:\fP\fIgroup\fP).
+If a user is specified without a group, the primary GID for that user is used.
 When using this option
 you must realize that the primary and supplemental groups are set as well,
 even if the
@@ -231,7 +232,7 @@
 file will not be removed when stopping the program.
 This feature may not work in all cases. Most notably when the program
-being executed forks from its main process. Because of this it is usually
+being executed forks from its main process. Because of this, it is usually
 only useful when combined with the
 .B \-\-background
@@ -239,6 +240,47 @@
 .BR \-v ", " \-\-verbose
 Print verbose informational messages.
+.B start\-stop\-daemon
+returns 0 if the requested action was performed, or if
+.B \-\-oknodo
+is specified and either
+.B \-\-start
+was specified and a matching process was already running, or
+.B \-\-stop
+was specified and there were no matching processes.  If
+.B \-\-oknodo
+was not specified and nothing was done, 1 is returned.  If
+.B --stop
+.B --retry
+were specified, but the end of the schedule was reached and the processes were
+still running, the error value is 2.  For all other errors, the status is 3.
+.B --exec
+can fail to detect a running daemon after the executable is replaced (eg.
+during a package upgrade), since the executable is stored with a different
+.RB "Start the " food " daemon, unless one is already running (a process named food, running as user food, with pid in food.pid):"
+start-stop-daemon --start --oknodo --user food --name food --pidfile /var/run/food.pid --startas /usr/sbin/food --chuid food -- --daemon
+.RB "Send " SIGTERM " to " food " and wait up to 5 seconds for it to stop:"
+start-stop-daemon --stop --oknodo --user food --name food --pidfile /var/run/food.pid --retry 5
+.RB "Demonstration of a custom schedule for stopping " food :
+start-stop-daemon --stop --oknodo --user food --name food --pidfile /var/run/food.pid --retry=TERM/30/KILL/5
 Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl> based on
 a previous version by Ian Jackson <ian@chiark.greenend.org.uk>.

Reply to: