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

Re: PROPOSAL: init file actions

> status
>      print the current status of the service

It might be good to say what it must include. Also you might want a 
machine testable version so you can do

	if { foo-server running } ; then
		whatever &
		echo "You do not appear to be running the foo-server"
		echo "barengine will not be started"

> These executable files should not fail obscurely when the configuration
> files remain but the package has been removed, as the default in [the

This is problematic

Ok the flaws in my opinion:

1.	It assumes everything is a service. Some things are run at boot time
	only - for example firmware loaders for cards.

	[Allow such things to not support anything but 'start']

2.	It assumes the script is tied to a binary and the script might
	remain. At least one of my firmware loaders is a dd script...

	[Either remove scripts or retire them to an attic directory]

3.	It doesn't specify an exit code for success/failure/serious error

	[Specify the obvious]

4.	It needs to say what sort of info "status" returns. A compliant script
	is entitled to write witty poems right now.

	[name, state, version, if possible what config file it is using

5.	It needs to address name space collisions

	[Tie the script to the lsb package name ? This also makes it easier
	 for the end user]

6.	Consistant output formats.

	Define an includable file that provides functions

	start_daemon has been mentioned already


	copyright "x"

	Print a copyright banner in the format used by this platform

	doing "xyz"

	Print the first part of a line with a message indicating what is
	being attempted


	Print the [ OK ]  [ WARNING ] [ ERROR ] type end of line messages
	or any other format the distribution has chosen.

	log_error app string

	Log an error to the system startup log only if applicable.

This all helps to ensure that the vendors release packages that look and feel
like the OS vendors packages and makes it easier for them as it does so.

So you'd see something like

	copright "VideoMachine (c) Copyright 1999 The Banana Company"

	doing "Starting the VMachine"
	if [ -f /etc/vmachine.boot ] ; then
		if { start_daemon /usr/bin/vmachine } ; then
			exit 0
		log_error $0 "vmachine.boot has been deleted ?"

and will match on any platform.


Reply to: