Noip2 Init Script for Debian Etch

Running Debian Etch on my server seems at times like a gigantic step backward from the ubuntu server I used to run. But alas, it has been quite a learning experience. I just set up my server to run the No-IP dynamic update client (which is available as a package for ubuntu hardy), but it didn’t work with the included init script. Searching online I found very little help.

What I ended up doing was using my laptop (which runs hardy) to install the noip2 package, grabbed the init script, and moved it over to the debian box. For those of you who don’t have a hardy install to reference, here’s my init script. All I changed was the location of the executable from /usr/bin/noip2 to /usr/local/bin/noip2, the Default-Start to 2 3 4 5 and Default-Stop to 0 1 6 (I use a command line system, so my runlevel is normally 2, whereas a gui system would normally be 5).

/etc/init.d/noip2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/sh
# /etc/init.d/noip2
 
# Supplied by no-ip.com
# Modified for Debian GNU/Linux by Eivind L. Rygge <eivind@rygge.org>
# corrected 1-17-2004 by Alex Docauer <alex@docauer.net>
 
# . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc
 
### BEGIN INIT INFO
# Provides:          noip2
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: manage noip2 daemon (noip2)
# Description:       Manage the No-IP.com Dynamic DNS update client
### END INIT INFO
 
DAEMON=/usr/local/bin/noip2
 
test -x $DAEMON || exit 0
 
case "$1" in
    start)
    echo -n "Starting dynamic address update: "
    start-stop-daemon --start --exec $DAEMON
    echo "noip2."
    ;;
    stop)
    echo -n "Shutting down dynamic address update: "
    start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
    echo "noip2."
    ;;
 
    restart|force-reload)
    echo -n "Restarting dynamic address update: "
    start-stop-daemon --stop --oknodo --retry 30 --exec $DAEMON
    start-stop-daemon --start --exec $DAEMON
    echo "noip2."
    ;;
 
    *)
    echo "Usage: $0 {start|stop|restart|force-reload}"
    exit 1
esac
exit 0

Make sure you run the following to complete your installation:

$ chown root:root /etc/init.d/noip2
$ chmod 755 /etc/init.d/noip2
$ update-rc.d noip2 defaults

Leave a Reply