![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
RedHat Init Script Version 2.0
The code fragment below has been encapsulated in <html> and <pre> tags, so it should be easy to copy and paste the whole chunk into your favorite editor and save it. #!/bin/sh # # swiki Control the Squeak Swiki # # chkconfig: 345 99 10 # description: Control the Squeak Swiki # SWIKI_CMD="/usr/local/ComSwiki/squeak" SWIKI_IMG="/usr/local/ComSwiki/squeak.image" if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions else exit 0 fi . /etc/sysconfig/network [ ${NETWORKING} = "no" ] && exit 0 RETVAL=0 start() { echo -n "Starting Squeak Swiki: " $SWIKI_CMD -headless $SWIKI_IMG & RETVAL=$? [ $RETVAL -eq 0 ] && success || failure [ $RETVAL -eq 0 ] && touch /var/lock/subsys/swiki echo return $RETVAL } stop() { echo -n $"Stopping Squeak Swiki: " killproc squeak RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/swiki echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit $RETVAL The changes suggested by mangan@acm.org on the original page make sense. The original page has been locked, so the shell script has been copied here and updated apropriately. Links to this Page
|