[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2 copies started at once
From: |
Nick Upson |
Subject: |
Re: 2 copies started at once |
Date: |
Tue, 31 Jul 2007 09:38:58 +0100 |
an the bs.sh script
#!/bin/bash
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
1 | 2 | 3 | 4)
BSN="bs$1"
;;
*)
echo "Usage: $0 {1|2|3|4} {start|stop|status|restart}"
exit 1
;;
esac
PROG_BIN=/opt/unb/bin/bs
PIDFILE=/var/run/$BSN.pid
CONFFILE=/opt/unb/cnf/$BSN.cnf
start() {
echo -n $"Starting $BSN: "
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo $BSN already running: $PID
else
daemon -5 $PROG_BIN $CONFFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$BSN
fi
}
stop() {
echo -n $"Shutting down $BSN: "
killproc $BSN
echo
rm -f /var/lock/subsys/$BSN
return 0
}
case "$2" in
start)
start
;;
stop)
stop
;;
status)
status -p $PIDFILE bs
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {1|2|3|4} {start|stop|status|restart}"
exit 1
;;
esac
exit $?
- Re: 2 copies started at once, (continued)
- Re: 2 copies started at once, Nick Upson, 2007/07/27
- Re: 2 copies started at once, Jan-Henrik Haukeland, 2007/07/27
- Re: 2 copies started at once, Martin Pala, 2007/07/27
- Re: 2 copies started at once, Nick Upson, 2007/07/28
- Re: 2 copies started at once, Martin Pala, 2007/07/29
- Re: 2 copies started at once, Nick Upson, 2007/07/30
- Re: 2 copies started at once, Nick Upson, 2007/07/30
- Re: 2 copies started at once, Martin Pala, 2007/07/30
- Re: 2 copies started at once, Martin Pala, 2007/07/30
- Re: 2 copies started at once, Nick Upson, 2007/07/31
- Re: 2 copies started at once,
Nick Upson <=
- Re: 2 copies started at once, Nick Upson, 2007/07/31