Start applikation (Noip) @boot

Hello,

i want to visit my raspberry pi 2/OSMC over the Internet. I have installed the Noip applikation on my raspberry pi 2 with the following commands;

mkdir ~/noip && cd ~/noip

tar vzxf noip-duc-linux.tar.gz

cd noip-2.1.9-1

Now i can start the applikation with sudo /usr/local/bin/noip2, everythink works fine. But i want that the applikation noip start automaticly with the boot of the raspberry pi. I try two diffrent options but no option works for me (i have no clue about linux, maybe this is the problem):

Option 1:
Try to do it with the comtab (the cromtab applikation is installed on my raspberry pi2):

crontab -e

and add the following line:

@reboot cd /home/osmc/noip && sudo noip2

Option 2:
Try to do it with the rc.local:

sudo nano /etc/rc.local

and add the following line:

@reboot /usr/local/bin/noip2 and as other option @reboot sudo /usr/local/bin/noip2

before exit 0

Non of these options work. So what can i do to start noip with the boot of the raspberry pi 2? Many, many thanks for your help.

Did you install cron ? It is not installed by default on OSMC.

I don’t know what you expect that to do - it’s not valid crontab syntax. You need to look up the man page for crontab.

rc.local only runs once during boot and typically runs before the network is up, so this won’t do what you want.

Again, I don’t know what you’re trying to do with @reboot - this is not valid in rc.local either…

@reboot is valid in cron, but I would suggest an init script to track the process more thoroughly.

S

Many thanks for your help:

Yes i installed the cron tab with the OSMC Store. I find some tutorials in the internet that work with the @reboot comman in crontabs. Anyway i do not get it to work with this method but thanks for your help.

@sam_nazarko: Your tip to work with init script was very, very good. Many, many thanks. My solution if somebody have the same problem: I tried the following tutorial

[<Stuff about="code" />: Raspberry Pi - run program at start-up][1]

In the script from this side you had to replace “killall” with “pkill”. Now everything works perfect.

Thanks for the help, here is a great community. And the OSMC software is outstanding. Thanks

Hello Badboy,

I just installed noip2 into my raspberry Pi with osmc and it works well.

Below my method, I hope this will solve your problem. I think it the right way to do it ! (forget cron it’s not for this)

Best regards

Digii

sudo su
apt-get install build-essential
cd /usr/local/src/
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar xf noip-duc-linux.tar.gz
cd noip-2.1.9-1/
make install
/usr/local/bin/noip2 -C

7.5) (start background)

/usr/local/bin/noip2
  1. create file name “noip2” into /etc/init.d (script start / stop)

    nano /etc/init.d/noip2

  2. Put the following script into the file and save

    #! /bin/bash

    BEGIN INIT INFO

    Provides: noip2

    Required-Start: $local_fs $network

    Required-Stop: $local_fs $network

    Default-Start: 2 3 4 5

    Default-Stop: 0 1 6

    Short-Description: No IP Client for Dynamic IP

    END INIT INFO

    case “$1” in
    start)
    echo “Starting noip2.”
    /usr/local/bin/noip2
    ;;
    stop)
    echo -n “Shutting down noip2.”

    killproc -TERM /usr/local/bin/noip2

     	for i in `noip2 -S 2>&1 | grep Process | awk '{print $2}' | tr -d ','`
     	do
     			noip2 -K $i
     	done
     ;;
     *)
     echo "Usage: $0 {start|stop}"
     exit 1 
    

    esac
    exit 0

  3. Change owner file

    chown root:root /etc/init.d/noip2

  4. Change file permission to make the file executable

    chmod 755 /etc/init.d/noip2

  5. Test the script
    a) Check if process is running

    ps -eaf | grep noip2

    (exemple) nobody 266 1 0 09:21 ? 00:00:00 /usr/local/bin/noip2
    b) stop

    /etc/init.d/noip2 stop

c) Check if process is running

ps -eaf | grep noip2

no process
d) start

/etc/init.d/noip2 start

e) Check if process is running

ps -eaf | grep noip2
  1. Auto start at boot

    update-rc.d noip2 defaults

  2. Reboot and check process

  3. Check if process is running

    ps -eaf | grep noip2

2 Likes