The distribution is RHEL 5.
The script has been added to chkconfig like so:
# chkconfig --add script
# chkconfig script on
But it refuses to start when taking up the machine, what could be the problem?
#!/bin/bash
#
# chkconfig: 2345 20 80
# description: starts script
. /etc/rc.d/init.d/functions
PATHB=/xxxx/opt/virtualenvs/primary/bin
USER=userx
function start() {
/usr/bin/sudo /bin/su - $USER -c "$PATHB/script start"
}
function stop() {
/usr/bin/sudo /bin/su - $USER -c "$PATHB/script stop"
}
function status() {
/usr/bin/sudo /bin/su - $USER -c "$PATHB/script status"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac