[Ddclient-forum] [ddclient - Developers] Running ddclient from inittab
Brought to you by:
supersandro2000,
wimpunk
From: SourceForge.net <no...@so...> - 2007-08-15 21:59:48
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4467257 By: fest3er Some years ago, I had trouble keeping ddclient running reliably. IIRC, ddclient would 'hang' and stop updating the dyndns service. As a workaround, I wrote the following shell script to be run via init(1). The basic idea is that init(1) runs the script. The script runs ddclient, then sleeps for some minutes, to give ddclient enough time to do its job. Then, regardless of the update's success, ddclient is killed. When the script exits, init(1) restarts it. I did this because ddclient, as a daemon, was hanging and not updating the DNS entry. Ameritech's DSL system changes the IP address almost as often as humans blink. Because I needed reliable remote access to the target system, I decided to use init(1) to be sure that ddclient ran regularly. Since then, ddclient has been more stable than bedrock (plate tectonics, you see...). Five years now and it's been running without a hitch. So, in case this option might be of use to the project or to others, here's the inittab entry and the shell script: inittab entry: DD:23:respawn:/etc/ddclient.sh shell script: #! /bin/sh # 4/10/02 Neal P. Murphy # Donated to the ddclient project, 8/15/07 # ddclient shell script to run from init(1) # run once, sleep 300 seconds and exit, letting init(1) # restart it. # Run ddclient in background and save PID /usr/sbin/ddclient -pid "/var/run/ddclient.pid"& PID=$! # Give ddclient 5 minutes to do its magic, then murder it sleep 300 kill -9 $PID `cat /var/run/ddclient.pid 2>/dev/null` >/dev/null 2>&1 rm -f /var/run/ddclient.pid >/dev/null 2>&1 # Now exit, and let init restart it exit 0 ______________________________________________________________________ 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=399429 |