Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
Ok, can you post the first lines of any other script in /etc/init.d? I guess you have to add something similar to /etc7init.d/mydns so that the chkconfig program knows what to do.
After 2 days of trying to get this to work I still can't figure out what is missing. Here is the /etc/init.d/snmpd script in it entirity. Maybe you can see what I am missing. If you want a diffrent file let me know. SNMP seemed the easist for me to understand.
I finally fixed it so that it works with out manually adding anything. I edited the init script to look like this. And it works now with the instructions provided. It also now show up when you run ntsysv. Hope this helps somebody else in the future.
Code:
#! /bin/sh
# mydns Start the MyDNS server
# Author: Falko Timme <ft@falkotimme.com>.
# Comments to support chkconfig on RedHat Linux
# chkconfig: 235 90 90
# description: A DNS server that runs off of a MySQL backend
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=mydns
DAEMON=/usr/local/sbin/$NAME
DESC="DNS server"
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
$DAEMON --background
echo "."
;;
stop)
echo "Stopping $DESC: $NAME."
kill -9 `pidof $NAME` &> /dev/null
;;
restart)
echo "Restarting $DESC: $NAME."
$0 stop && sleep 1
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
exit 1
;;
esac
exit 0
Recent comments
1 day 11 hours ago
1 day 14 hours ago
2 days 2 hours ago
2 days 4 hours ago
2 days 8 hours ago
2 days 15 hours ago
3 days 35 min ago
3 days 2 hours ago
3 days 10 hours ago
3 days 11 hours ago