#! /bin/bash # # LSB compliant service control script; see http://www.linuxbase.org/spec/ # ### BEGIN INIT INFO # Provides: cit054 # Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Description: CIT054 startup script example ### END INIT INFO # Comments to support chkconfig # chkconfig: # description: CIT054 startup script example # Include shell functions needed by rc # . /etc/rc.status # for SuSE #. /lib/lsb/init-functions # for Ubuntu . /etc/init.d/functions # for Mandriva # Reset status of this service # rc_reset # for SuSE # # For Mandriva, the start must create a "lock" file to # indicate that a service is running, and it must # remove that file when stopping the service. LOCKFILE=/var/lock/subsys/cit054 LEVEL=$(/sbin/runlevel) # # Replace [[your full name here]] with your full name, please. # case "$1" in start) gprintf "Starting [[your full name here]]" touch $LOCKFILE echo "$(date) startup level $LEVEL [[your full name here]]" \ >> /tmp/initstuff # rc_status -v # for SuSE success # for Mandriva echo ;; stop) gprintf "Shutting down [[your full name here]]" rm -f $LOCKFILE echo "$(date) shutdown level $LEVEL [[your full name here]]" \ >> /tmp/initstuff # rc_status -v # for SuSE success # for Mandriva echo ;; restart) $0 stop $0 start # rc_status # for SuSE ;; *) echo "Usage: $0" \ "{start|stop|restart}" exit 1 ;; esac # rc_exit # for SuSE