#1  
Old 6th March 2006, 21:03
kaptk2 kaptk2 is offline
Junior Member
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default MyDNS CentOS start on Reboot

When following the MyDNS howto I get to this step:

On Fedora or RedHat, you would run this:

chkconfig --levels 235 mydns on

Upon running that command I get this error message:
service mydns does not support chkconfig

I am running CentOS 4.2 any hints on how to get it so that on a reboot MyDNS will come up.
Reply With Quote
Sponsored Links
  #2  
Old 6th March 2006, 23:25
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Is /etc/init.d/mydns executable?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 6th March 2006, 23:33
kaptk2 kaptk2 is offline
Junior Member
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it is.

# ls -li /etc/init.d/mydns
1378476 -rwxr-xr-x 1 root root 775 Mar 6 11:21 /etc/init.d/mydns
Reply With Quote
  #4  
Old 7th March 2006, 00:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 8th March 2006, 19:57
kaptk2 kaptk2 is offline
Junior Member
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Code:
#!/bin/bash
# ucd-snmp init file for snmpd
#
# chkconfig: - 50 50
# description: Simple Network Management Protocol (SNMP) Daemon
#
# processname: /usr/sbin/snmpd
# config: /etc/snmp/snmpd.conf
# config: /usr/share/snmp/snmpd.conf
# pidfile: /var/run/snmpd

# source function library
. /etc/init.d/functions

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd -a"
RETVAL=0
prog="snmpd"

start() {
        echo -n $"Starting $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                daemon /usr/sbin/snmpd $OPTIONS
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd
        fi;
        echo
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                killproc /usr/sbin/snmpd
                RETVAL=$?
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/snmpd
        fi;
        echo
        return $RETVAL
}

reload(){
        echo -n $"Reloading $prog: "
        killproc /usr/sbin/snmpd -HUP
        RETVAL=$?
        echo
        return $RETVAL
}

restart(){
        stop
        start
}

condrestart(){
    [ -e /var/lock/subsys/snmpd ] && restart
    return 0
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  condrestart)
        condrestart
        ;;
  status)
        status snmpd
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        RETVAL=1
esac

exit $RETVAL
Reply With Quote
  #6  
Old 8th March 2006, 21:25
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Please put
Code:
# chkconfig: - 21 22
somewhere at the beginning of /etc/init.d/mydns and run
Code:
chkconfig --levels 235 mydns on
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 8th March 2006, 21:50
kaptk2 kaptk2 is offline
Junior Member
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No good. I am still getting this error message:
service mydns does not support chkconfig

Here is how my file looks now. It is snipped but the rest is what is on the website. Any more hints?

Code:
#! /bin/sh
#
#
# chkconfig: - 21 22
#
# mydns         Start the MyDNS server
#
# Author:       Falko Timme <ft@falkotimme.com>.
#

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=mydns
DAEMON=/usr/local/sbin/$NAME
DESC="DNS server"
Reply With Quote
  #8  
Old 8th March 2006, 22:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

You can create the needed system startup links for mydns by hand:

Code:
ln -s /etc/init.d/mydns /etc/rc.d/rc2.d/S21mydns
ln -s /etc/init.d/mydns /etc/rc.d/rc3.d/S21mydns
ln -s /etc/init.d/mydns /etc/rc.d/rc5.d/S21mydns
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 3rd April 2006, 05:54
kaptk2 kaptk2 is offline
Junior Member
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default Fixed It!

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
normal HTTPD wont start traxxdata Installation/Configuration 4 1st February 2008 18:23
Packages Centos misterm Installation/Configuration 1 3rd February 2006 02:10
Notes for CentOS 4.1 install felipegeek Installation/Configuration 6 19th December 2005 11:21
Installation does not start...... bharatdevdas Installation/Configuration 6 22nd November 2005 15:01
Key moments for CentOS 4.2 ? fofan Installation/Configuration 1 21st November 2005 23:56


All times are GMT +2. The time now is 14:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.