[root@cent6 ~]# vi /etc/init.d/diced #!/bin/sh # # chkconfig: 35 99 99 # description: DiCE # # processname: diced # . /etc/rc.d/init.d/functions RETVAL=0 prog="diced" lockfile=/var/lock/subsys/$prog DICED="/usr/local/bin/DiCE/diced" OPTIONS="-d" start() { [ -x $DICED ] || exit 5 [ ! -e $lockfile ] || exit 1 echo -n $"Starting $prog: " $DICED $OPTIONS && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch $lockfile echo return $RETVAL } stop() { echo -n $"Stopping $prog: " if [ -n "`pidofproc $DICED`" ] ; then killproc $DICED else failure $"Stopping $prog" fi RETVAL=$? [ $RETVAL -eq 0 ] && rm -f $lockfile echo } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|restart}" RETVAL=2 esac exit $RETVAL [root@cent6 ~]# chmod 700 /etc/init.d/diced [root@cent6 ~]# chkconfig --add diced [root@cent6 ~]# chkconfig --list diced diced 0:off 1:off 2:off 3:on 4:off 5:on 6:off [root@cent6 ~]# service diced start diced を起動中: =-=-=- DiCE DynamicDNS Client -=-=-= Version 0.19 for Japanese Copyright(c) 2001 sarad DiCE Daemon Started !! [ OK ] [root@cent6 ~]# |