Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4176949
By: clander
I have recently created a SuSE run control script within /etc/init.d so that
I could add ddclient as a run lelvel service.
The script is a hybrid from existing RCscripts, scripts installed along with
the ddclient package, and my own efforts.
AFAIK having done some testing on my own system it works as expected on the
command prompt and within Yast->System->System sewrvices (Runlevel)
I hope this may prove useful to others...
Best regards
Chris Lander
-[BEGIN]-
#! /bin/sh
# Copyright (c) 2002-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Adapted from an original script created by Lars Mueller <lm...@su...>,
# along with further input from the ddclient distribution this script is a
# heavily modified hybrid authored by Chris Lander <cl...@la...> that
# was created on a SuSE 10.0-OSS system.
#
# /etc/init.d/ddclient
# and its symbolic link
# /usr/sbin/rcddclient
#
### BEGIN INIT INFO
# Provides: ddclient
# Required-Start: $network syslog
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Dynamic DNS service update deamon
### END INIT INFO
DDCLIENT_BIN="/usr/sbin/ddclient"
DDCLIENT_CMD="ddclient"
DDCLIENT_CONF="/etc/ddclient.conf"
PID_FILE="/var/run/ddclient.pid"
. /etc/rc.status
rc_reset
# Check for missing binary
if [ ! -x ${DDCLIENT_BIN} ]; then
echo -n >&2 "ddclient daemon, ${DDCLIENT_BIN} is not installed. "
rc_status -s
exit 5
fi
case "$1" in
start)
echo -n "Starting ddclient daemon "
if [ ! -f ${DDCLIENT_CONF} ]; then
echo -n >&2 "ddclient configuration file, ${DDCLIENT_CONF}
does not exist. "
rc_status -s
exit 6
fi
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
case $? in
0) echo -n "- Warning: daemon already running.
" ;rc_failed;rc_status -v;exit;;
esac
${DDCLIENT_CMD} -daemon 300 -file ${DDCLIENT_CONF}
rc_status -v
;;
stop)
echo -n "Shutting down ddclient daemon "
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
if [[ $? -eq 0 ]]; then
killproc -p ${PID_FILE} -t 10 ${DDCLIENT_CMD}
else
echo -n " Warning: daemon not running. "
rc_failed
fi
rc_status -v
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather
than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
status)
echo -n "Checking for ddclient daemon "
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|}"
exit 1
;;
esac
rc_exit
-[END]-
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=399428
|