Index: initfunctions.sgml
===================================================================
RCS file: /cvsroot/lsb/lsbspec/gLSB/sysinit/initfunctions.sgml,v
retrieving revision 1.11
diff -u -r1.11 initfunctions.sgml
--- initfunctions.sgml	12 Aug 2003 21:31:28 -0000	1.11
+++ initfunctions.sgml	28 Aug 2003 19:34:37 -0000
@@ -13,14 +13,35 @@
 defined by POSIX.2.
 </PARA>
 
+<PARA>
+The <code>start_daemon</code>, <code>killproc</code> and <code>pidofproc</code>
+functions shall use this algorithm for determining the status and the pid(s)
+of the specified program. They shall read the pidfile specified or otherwise
+<code>/var/run/basename.pid</code>. 
+The method used to determine whether a program is running is implementation
+defined, but should allow for non-binary programs.
+<footnote>
+This note is only informative. Commonly used methods check either for the
+existance of the <code>/proc/pid</code> directory or use
+<code>/proc/pid/exe</code> and <code>/proc/pid/cmdline</code>. Relying only on
+<code>/proc/pid/exe</code> is discouraged since this results in a
+not-running status for daemons that are written in a script language.
+</footnote>
+Complient implementations may use other mechanism besides using those based on
+pidfiles. Compliant applications should not rely on such mechanisms and should
+always use a pidfile. The pidfile should be deleted when the program is
+stopped. Multiple pid(s) shall be separated by a single space in the pidfile
+and in the output of <code>pidofproc</code>.
+</PARA>
+
 <SIMPLELIST type=horiz columns=2>
 <MEMBER>start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args]</MEMBER>
 
 <MEMBER>
 This runs the specified program as a daemon.
-start_daemon will check to see if the program is already running
-using the algorithm given by pidofproc. If so, it will not
-start another copy of the daemon unless the -f
+start_daemon shall check if the program is already running
+using the algorithm given above. If so, it shall not
+start another copy of the daemon unless the <code>-f</code>
 option is given. The -n option specifies a nice
 level. See nice(1).
 start_daemon should return the LSB defined exit status codes. It
@@ -32,14 +53,16 @@
 
 <MEMBER>
 This stops the specified program. The program is 
-found using the algorithm given by pidofproc. If a
+found using the algorithm given above. If a
 signal is specified, using the
 -<replaceable>signal_name</replaceable> or
 -<replaceable>signal_number</replaceable> syntaxes
-specified by the <command>kill</command> command,
+as specified by the <command>kill</command> command,
 the program is sent that signal.
 Otherwise, a SIGTERM followed by a SIGKILL
-after some number of seconds is sent.
+after some number of seconds shall be sent.
+If a program has been terminated, the pidfile should be removed if the
+terminated process has not already done so.
 Compliant applications may use the basename instead of the 
 pathname.
 killproc should return the LSB defined exit status codes. If called
@@ -52,22 +75,10 @@
 
 <MEMBER>
 This function returns one or more pid(s) for a particular
-daemon. If an entry is found in
-/var/run/basename.pid, then that value is returned.
-If the -p option is used, the given pidfile is used instead.
-Compliant applications may use the basename instead of the
-pathname.
-Compliant implementations of the LSB may attempt
-other mechanisms for determining the pid(s),
-although this is not required (and not
-recommended, since a user can trick startup scripts
-by creating processes that appear to be system
-programs in the process list thus creating a
-potential security exposure).  Hence, LSB-complaint
-applications who wish to use the pidofproc function
-in their init scripts shall store the pid in
-/var/run/basename.pid. multiple pids should be separated by a single space.
-pidofproc should return the LSB defined exist status
+daemon using the algorithm given above. Only pids of running processes
+should be returned.
+Compliant applications may use the basename instead of the pathname.
+pidofproc should return the LSB defined exit status
 codes for "status". It shall return 0 if the program is
 running and not 0 otherwise.
 </MEMBER>
