Linux

init script for SoftSqueeze

I wanted to not have to start SoftSqueeze manually every time I started the computer, so I decided to muddle with existing scripts and generate my own init.d script.

This script was the SlimServer scripts, modified to start SoftSqueezeHeadless.

#!/bin/bash
#
# /etc/rc.d/slimserver

RETVAL=0
prog=”SOFTSQUEEZE”

#. /etc/sysconfig/slimserver

#cd $SLIMSERVER_HOME
#SLIMSERVER_BIN=”softsqueezeHeadless”

#[ -x $SLIMSERVER_BIN ] || exit 5

start() {
       echo -n “Starting Softsqueeze Headless: “
       su – root -c “softsqueezeHeadless”
       RETVAL=$?
       echo
#       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/slimserver && echo “done”
       return $RETVAL
}

stop() {
       echo -n “Stopping Softsqueeze Headless: “
       killall softsqueezeHeadless
       RETVAL=$?
       echo
#       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/slimserver && echo “done”
       return $RETVAL
}

# See how we were called.
case “$1” in
       start)
             start
             ;;
       stop)
             stop
             ;;
       restart|reload)
             stop
             start
             RETVAL=$?
             ;;
       *)
             echo “Usage: $0 {start|stop|restart}”
             exit 1
esac
exit $RETVAL

There is some info on the web (Novell’s site) that seems to present a somewhat simpler method to do this, but I haven’t yet tried it.

Interesting Links:

Novell’s init scrpt HOWTO

Running a VMware Virtual Machine as a Service

Leave a Reply

Your email address will not be published. Required fields are marked *