create a startup script for krb5kdc, and using chkconfig

Le Trung Kien aloneattack at gmail.com
Sun Feb 24 23:17:50 EST 2008


Hi, I'm attempting to create a startup script for krb5kdc daemon to start
automatically at the booting of system.
And here is my content of krb5kdc script:

*************************************************************************************
#! /bin/bash
#
# krb5kdc          Start/Stop the krb5kdc daemon.
#
# chkconfig: - 9 60
# description:
# processname: krb5kdc
# config:
# pidfile:

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

RETVAL=0

# See how we were called.

prog="krb5kdc"

start() {
        echo -n $"Starting $prog: "
        daemon krb5kdc
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/krb5kdc
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        killproc krb5kdc
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/krb5kdc
        return $RETVAL
}

rhstatus() {
        status krb5kdc
}

restart() {
        stop
        start
}

reload() {
        echo -n $"Reloading krb5kdc daemon configuration: "
        killproc krb5kdc -HUP
        retval=$?
        echo
        return $RETVAL
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  status)
        rhstatus
        ;;
  krb5kdcrestart)
        [ -f /var/lock/subsys/krb5kdc ] && restart || :
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|reload|restart|krb5kdcrestart}"
        exit 1
esac

exit $?

*************************************************************************************

then I place this file in /etc/rc.d/init.d directory and use

chkconfig --add krb5kdc

I got :

service krb5kdc does not support chkconfig

Any suggestion please.

Thank you.
Le Trung Kien



More information about the Kerberos mailing list