2 set -e # end if anything fails
4 # tag: if the next line is changed/removed a reinstall of sysd2sysv will keep this file
8 PROG_PATH=$(which $PROG) || { echo "$PROG missing"; exit 1; }
11 syserr=/tmp/%PROG%.err
15 . /lib/lsb/init-functions
18 echo "$0 [options] start|restart|stop"
19 echo " -l <syslog> DEFAULT: $syslog"
20 echo " -e <errlog> DEFAULT: $syserr"
25 # check, if process is already running
26 if [ `ps -ef | grep $PROG_PATH | grep -v grep | grep -v bash | wc -l` -gt 0 ]
32 log_daemon_msg $PROG || true
33 ($PROG &) 1>>$syslog 2>>$syserr
35 if status_of_proc $PROG
44 if [ `ps -ef | grep $PROG_PATH | grep -v grep | grep -v bash | wc -l` -gt 0 ]
46 echo -n $PROG" is running..."
49 echo -n $PROG" is stopped"
55 log_daemon_msg "Stopping $PROG"
56 kill $(ps aux |grep $PROG_PATH |grep -v grep | awk '{print $2}') || true
85 if [ -f $syslog ]; then rm $syslog; fi
103 if [ -f $syserr ]; then rm $syserr; fi