(View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide)

swiki server

Here is an init script for debian linux. The only things that have to be changed are:

(Save this as Text to use it or better (less fiddling) use the gzipped version.) It can then be copied into /etc/init.d
cp swiki /etc/init.d
its permissions corrected / made executable with
chown root:root /etc/init.d/swiki
chmod 755 /etc/init.d/swiki
and then the appropriate symlinks have to be set to automate start and stop:

update-rc.d swiki defaults 90 14
———cut here————-

# swiki
# swiki init script, debian style
# Version: @(#)swiki 1.1 08-Aug-2002 t3 - copying: GPL

ARGS="-headless -memory 120m squeak.image"

test -x $DAEMON || exit 0

set -e
#set -x

case "$1" in
echo -n "Starting $DESC: $NAME"
su -s /bin/bash -c "(cd $DIR && $DAEMON $ARGS &)" - swiki
#start-stop-daemon -b --start --chuid swiki --exec $DAEMON -- $ARGS
#start-stop-daemon -b --start --quiet --chuid swiki --exec $DAEMON -- $ARGS
echo "."
echo -n "Stopping $DESC: $NAME "
start-stop-daemon --stop --quiet --name $NAME
echo "."
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
# echo -n "Reloading $DESC configuration..."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
# echo "done."
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
echo "."
# echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1

exit 0


Link to this Page