SERVICES(5)

NAME
rcfile - the format of a Mastodon rc file.

DESCRIPTION
A Mastodon rc file is a program that is run to start or stop a system service. These files are executed by rc(8) when the system changes runlevels. When run by rc and related programs, these programs are passed one argument, as follows:

start
    Start the service.

stop
    Stop the service.

info
    print a brief description of what this program is in charge of starting or stopping.

EXAMPLES
To make a rc program that starts or stops somedaemond:
	#! /bin/sh
	. /etc/rc.d/sysconfig
	PATH=/bin:/sbin:/usr/bin:/usr/sbin:/etc/rc.d/functions; export PATH
	case x"$1" in
	start)
	    need network
	    echo "Starting somedaemon"
	    somedaemond &
	    ;;
	stop)
	    echo "Stopping somedaemon"
	    killall somedaemond 2>/dev/null
	    ;;
	info)
	    echo "Some Daemon"
	    ;;
	*)
	    echo "Usage: $0 {start|stop}" 1>&2
	    exit 1
	    ;;
	esac
	exit 0
When this script starts, it first sources in the Mastodon master configuration file, then it sets its path to the common 4 directories plus the rc.d functions directory, and finally checks to see what it needs to do. If it needs to start somedaemon, it loads the prerequisites (the network) and starts the daemon.

SEE ALSO
rc(8), rc(7)

AUTHOR
David Parsons (orc@pell.chi.il.us)