[SOLVED] Custom rc.d init script - doesn't start on boot
by marav from LinuxQuestions.org on (#5DXAN)
Hi there,
I've a custom script in /etc/rc.d
It works well with start / stop & status command
But doesn't want to start on boot
In my memory, custom script needs to be executable and have a start) command inside
Did I miss something ?
Here is the script :
Code:duplicati_start() {
initlog -c "echo -n Starting duplicati server:"
/usr/bin/duplicati-server $DAEMON_OPTS &
echo $PID > $PIDFILE
echo $PID_MONO > $PIDFILE_MONO
}
case "$1" in
start)
duplicati_start
;;
stop)
kill -9 $PID_MONO
echo 0 > $PIDFILE_MONO
echo mono-sgen stopped.
kill -9 $PID
echo 0 > $PIDFILE
echo DuplicatiServer stopped.
;;
status)
if [ $PID > 0 ]; then
echo $NAME is running.
else
echo $NAME is stopped.
fi
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 5
esac
exit $?


I've a custom script in /etc/rc.d
It works well with start / stop & status command
But doesn't want to start on boot
In my memory, custom script needs to be executable and have a start) command inside
Did I miss something ?
Here is the script :
Code:duplicati_start() {
initlog -c "echo -n Starting duplicati server:"
/usr/bin/duplicati-server $DAEMON_OPTS &
echo $PID > $PIDFILE
echo $PID_MONO > $PIDFILE_MONO
}
case "$1" in
start)
duplicati_start
;;
stop)
kill -9 $PID_MONO
echo 0 > $PIDFILE_MONO
echo mono-sgen stopped.
kill -9 $PID
echo 0 > $PIDFILE
echo DuplicatiServer stopped.
;;
status)
if [ $PID > 0 ]; then
echo $NAME is running.
else
echo $NAME is stopped.
fi
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 5
esac
exit $?