All pastes #3129 Raw Edit

mandrake startup

public text v1 · immutable
#3129 ·published 2004-12-17 21:08 UTC
rendered paste body
Mandrake Generic Startup Init Script
This script is an example of what a generic startup script in Mandrake. Clearly you will need to replace FOOBAR with whatever your daemon is called. (This script is public domain property.)

You can either download the generic startup script here. Or you can view it below:

#!/bin/sh
#
# Startup script for FOOBAR
#
# chkconfig: 2345 80 30
#
# description: FOOBAR is a deamon process that creates world peace, stops \
#              all hunger on earth, gets rid of the pollution, and gives \
#              every child a toy to play with
#
# processname: FOOBAR

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
        exit 0
fi

# Source FOOBAR configuration.
if [ -f /etc/sysconfig/FOOBAR ] ; then
        . /etc/sysconfig/FOOBAR
else
        FOOBAROPTIONS="-d -c -a"
fi

[ -f /usr/bin/FOOBAR -o -f /usr/local/bin/FOOBAR ] || exit 0

# See how we were called.
case "$1" in
  start)
        gprintf "Starting FOOBAR: "
        daemon FOOBAR $FOOBAROPTIONS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/FOOBAR
        ;;
  stop)
        gprintf "Shutting down FOOBAR: "
        killproc FOOBAR
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/FOOBAR
        ;;
  status)
        status FOOBAR
        RETVAL=$?
        ;;
  restart)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
  reload)
        gprintf "Re-reading FOOBAR config: "
        killproc FOOBAR -HUP
        RETVAL=$?
        echo
        ;;
  *)
        gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0"
        exit 1
esac

exit 0