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

Bug#208010: [PROPOSAL] init script LSB 1.3 compliance



This one seems okay. Seconded as amended.

On Wed, Sep 03, 2003 at 09:57:46AM +0200, Martin Godisch wrote:
> Andrew, Wouter, Steve, do your objections still apply to the current
> revision (attached below)?

> +++ debian-policy-3.6.1.0/policy.sgml	2003-09-02 06:53:48.000000000 +0200
> @@ -5362,13 +5362,16 @@
>  	      <tag><tt>force-reload</tt></tag>
>  	      <item>cause the configuration to be reloaded if the
>  		  service supports this, otherwise restart the
> -		  service.</item>
> +		  service,</item>
> +
> +	      <tag><tt>status</tt></tag>
> +	      <item>print the current status of the service.</item>
>  	    </taglist>
>  
>  	    The <tt>start</tt>, <tt>stop</tt>, <tt>restart</tt>, and
>  	    <tt>force-reload</tt> options should be supported by all
>  	    scripts in <file>/etc/init.d</file>, the <tt>reload</tt>
> -	    option is optional.
> +	    and <tt>status</tt> options are optional.
>  	  </p>
>  
>  	  <p>
> @@ -5421,6 +5424,67 @@
>  	  </p>
>  
>  	  <p>
> +	    In the case of init script commands other than <tt>status</tt>,
> +	    the init script should return an exit status of zero if the action
> +	    described by the argument has been successful or the package is
> +	    removed but not purged. Otherwise, the init script should print an
> +	    error message and return a non-zero exit status code. Packages are
> +	    encouraged to select return codes based on the following list.
> +	    <taglist>
> +	      <tag>1</tag>
> +	      <item>generic or unspecified error,</item>
> +	      <tag>2</tag>
> +	      <item>invalid or excess argument(s),</item>
> +	      <tag>3</tag>
> +	      <item>unimplemented feature (for example, <tt>reload</tt>),</item>
> +	      <tag>4</tag>
> +	      <item>user had insufficient privilege,</item>
> +	      <tag>5</tag>
> +	      <item>reserved for LSB use,</item>
> +	      <tag>6</tag>
> +	      <item>program is not configured,</item>
> +	      <tag>7</tag>
> +	      <item>program is not running,</item>
> +	      <tag>8-99</tag>
> +	      <item>reserved for future LSB use,</item>
> +	      <tag>100-149</tag>
> +	      <item>reserved for distribution use,</item>
> +	      <tag>150-199</tag>
> +	      <item>reserved for application use,</item>
> +	      <tag>200-254</tag>
> +	      <item>reserved.</item>
> +	    </taglist>
> +	    All error messages should be printed on standard error. All status
> +	    messages should be printed on standard output. (This does not
> +	    prevent scripts from calling logging functions.)
> +	  </p>
> +
> +	  <p>
> +	    If the status command is given, the init script should return the
> +	    following exit status codes.
> +	    <taglist>
> +	      <tag>0</tag>
> +	      <item>program is running or service is OK,</item>
> +	      <tag>1</tag>
> +	      <item>program is dead and /var/run pid file exists,</item>
> +	      <tag>2</tag>
> +	      <item>program is dead and /var/lock lock file exists,</item>
> +	      <tag>3</tag>
> +	      <item>program is stopped,</item>
> +	      <tag>4</tag>
> +	      <item>program or service status is unknown,</item>
> +	      <tag>5-99</tag>
> +	      <item>reserved for future LSB use,</item>
> +	      <tag>100-149</tag>
> +	      <item>reserved for distribution use,</item>
> +	      <tag>150-199</tag>
> +	      <item>reserved for application use,</item>
> +	      <tag>200-254</tag>
> +	      <item>reserved.</item>
> +	    </taglist>
> +	  </p>
> +
> +	  <p>
>  	    Often there are some variables in the <file>init.d</file>
>  	    scripts whose values control the behaviour of the scripts,
>  	    and which a system administrator is likely to want to
> @@ -5648,6 +5712,14 @@
>    . /etc/default/bind
>  fi
>  
> +help () {
> +  echo "Usage: /etc/init.d/bind {start|stop|restart|reload|force-reload}" >&2
> +}
> +
> +if [ "$2" ]; then
> +  help
> +  exit 2
> +fi
>  
>  case "$1" in
>  start)
> @@ -5676,10 +5748,13 @@
>    echo "."
>    ;;
> +status)
> +  echo "Checking status of domain name service: unknown."
> +  exit 4
> +  ;;
>  *)
> -  echo "Usage: /etc/init.d/bind " \
> -         " {start|stop|restart|reload|force-reload}" >&2
> -  exit 1
> +  help
> +  exit 2
>    ;;
>  esac
>  
> @@ -5923,6 +5998,24 @@
>  		daemon starting message.
>  	      </p>
>  	    </item>
> +
> +	    <item>
> +	      <p>When the daemon's status is queried</p>
> +
> +	      <p>
> +		When the <tt>status</tt> option is given, the first line of
> +		output should have the following format:
> +		<example compact="compact">
> +Checking status of <var>description</var>: <var>short-state</var>.
> +		</example>
> +		where <var>description</var> is the same as in the daemon
> +		starting message, and <var>short-state</var> is one of
> +		<tt>running</tt>, <tt>dead, pid file exists</tt>, <tt>dead,
> +		lock file exists</tt>, <tt>stopped</tt>, and <tt>unknown</tt>,
> +		corresponding to the status exit code. A more verbose status
> +		report may follow if appropriate.
> +	      </p>
> +	    </item>
>  	  </list>
>  	</p>
>        </sect>




-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: pgp4Fr6Q1XRwz.pgp
Description: PGP signature


Reply to: