Default-Start contains no runlevels
2
votes
2
answers
19237
views
I am trying to make my custom made daemon run at startup
and when I call
update-rc.d ydcd enable
I get the error
update-rc.d: using dependency based boot sequencing
update-rc.d: error: MyDaemon Default-Start contains no runlevels, aborting.
I'm running Debian wheezy, init is SysVinit.
Googling it does not give me any valuable info, so I come here as a last resort.
What's going on here?
What do I need to change in my init.d script in order to make this work?
Edit:
Here's the script:
#!/bin/bash
#
#ydcd.daemon
#
# chkconfig: 2345 85 15
# description: MyServiceName
# processname: MyServiceName
# source function library
. /lib/lsb/init-functions
RETVAL=0
NAME=ydcd.daemon
# YOU CAN SET ANY PATH BUT IS RECOMENDED TO USE THE DISTRO'S STANDARD ONE.
DAEMON=/home/debian/yd_cd/$NAME
prog=$(basename $DAEMON)
lockfile=/var/lock/$NAM
SVC_FILE=$DAEMON
start() {
if [ -f $SVC_FILE ]; then
#reset
echo -n "Starting "$SVC_FILE": "
RETVALS=$(start-stop-daemon -S -b -x $SVC_FILE -- -r)
Count=${#RETVALS[@]}
RETVAL="[FAIL]"
if [ $Count -eq 0 ]; then
RETVAL="[OK]"
elif [ $Count -eq 1 ]; then
if [ ${#RETVALS} -eq 0 ]; then
RETVAL="[OK]"
else
iStart=${#SVC_FILE}
iLength=${#RETVALS}
Response=${RETVALS:(iStart+1):7}
RETVAL=$Response
if [ "$Response" == "already" ]; then
RETVAL="[OK]"
fi
fi
fi
echo $RETVAL
return 0
else
echo $SVC_ALIAS" not installed" $SVC_DIR
exit 2;
fi
}
stop() {
echo -n "Shutting down "$SVC_FILE":"
RETVALS=$(start-stop-daemon -K -x $SVC_FILE -- s)
#additional PROCKILLS=$(killall -w -q -e $SVC_PROCESS_NAME $SVC_FILENAME)
Count=${#RETVALS[@]}
Index=0
RETVAL="[FAIL]"
if [ $Count -eq 1 ]; then
if [ ${#RETVALS} -eq 0 ]; then
RETVAL="[OK]"
else
Response=${RETVALS:0:2}
RETVAL=$Response
if [ "$Response" == "No" ]; then
RETVAL="[OK]"
fi
fi
else
RETVAL="[OK]"
fi
echo $RETVAL
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $SVC_SERVICE_SCRIPT
;;
restart)
stop
start
;;
*)
echo $SVC_ALIAS" [Invalid Startup Parameters]"
echo "Usage: {start|stop|status|restart}"
exit 1
;;
esac
exit $?
Asked by vaid
(129 rep)
Jan 24, 2016, 02:17 AM
Last activity: Jun 26, 2025, 12:04 AM
Last activity: Jun 26, 2025, 12:04 AM