Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have just installed No-IP on a brand new Ubuntu 12.04 install. The program starts fine when I start it from the CLI, but if I try to make this startup script work it won't start.

I got this script from their install instructions:

#! /bin/sh
# . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc
case "$1" in
    start)
    echo "Starting noip2."
    /usr/local/bin/noip2
    ;;
    stop)
    echo -n "Shutting down noip2."
    killall -TERM /usr/local/bin/noip2
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
esac
exit 0

The CL is correct because if I run /usr/local/bin/noip2 it starts. But the script itself won't start it.

What do I have wrong in there? The script is executable:

-rwxrwxrwx   1 root root   299 Jan 12 13:28 noip*

EDIT

If I try the Init.d script it also works:

sudo /etc/init.d/noip start

It starts up just fine that way without a hitch.

share|improve this question

3 Answers 3

up vote 4 down vote accepted

You should run this (if you have not done so):

sudo update-rc.d noip2 defaults
share|improve this answer

Do you symlink to the /etc/init.d script from any /etc/rc?.d directory? I have

/etc/rc0.d/K10no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc1.d/K10no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc2.d/S90no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc3.d/S90no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc4.d/S90no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc5.d/S90no-ip.com -> ../init.d/no-ip.com.sh*
/etc/rc6.d/K10no-ip.com -> ../init.d/no-ip.com.sh*
share|improve this answer
2  
That is what update-rc.d is for. :) –  gertvdijk Jan 23 '13 at 0:37

It's very easy, I created a line in root crontab:

@reboot /usr/local/bin/noip2

When i power on or reboot my machine, the daemon starts automatically

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.