#!/bin/bash # # start the alois mysqlpipe # # The variables below are NOT to be changed. They are there to make the # script more readable. NAME=prisma-mysqlpipe WORKINGDIR=/usr/bin OPTIONS=-d DAEMON=$WORKINGDIR/$NAME PIDFILE=/var/run/$NAME # note: SSD is required only at startup of the daemon. SSD="`which start-stop-daemon`" ENV="/usr/bin/env -i LANG=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" trap "" 1 should_start() { if [ ! -x $DAEMON ]; then echo "$DAEMON not executable, not starting" exit 0 fi } case "$1" in start) should_start echo -n "Starting: $NAME" $ENV $SSD --start --pidfile $PIDFILE --startas $DAEMON -- $OPTIONS ;; stop) echo -n "Stopping: $NAME" $ENV $SSD --stop --oknodo --signal TERM --pidfile $PIDFILE --retry 10 ;; restart | force-reload) echo -n "Stopping: $NAME" $ENV $SSD --stop --oknodo --signal TERM --pidfile $PIDFILE --retry 10 echo -n "Starting: $NAME" $ENV $SSD --start --pidfile $PIDFILE --startas $DAEMON -- $OPTIONS ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart}" exit 1 ;; esac if [ $? -eq 0 ]; then echo . exit 0 else echo " failed" exit 1 fi