0

I trying to install NoIP in BBG, with debian. It's working, but just if I start the service manually:

sudo /usr/local/bin/noip2

I trying to put this on startup. I found this configuration but didn't work.

sudo cp debian.noip2.sh /etc/init.d/
sudo chmod +x /etc/init.d/debian.noip2.sh
sudo ln -s /etc/init.d/debian.noip2.sh /etc/rc2.d/S20noip

How can I put this command on startup:

sudo /usr/local/bin/noip2

Inside debian.noip2.sh

DAEMON=/usr/local/bin/noip2
NAME=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)
    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}"
    exit 1
esac
exit 0
  • What's in `debian.noip2.sh`? You don't need `sudo` for startup jobs because they already run with root privileges. – tripleee Jan 26 '18 at 11:44
  • Manually fiddling with `rc2.d` is probably not a good idea, though. Look at the [`update-rc.d` manual page](https://manpages.debian.org/jessie/sysv-rc/update-rc.d.8.en.html). – tripleee Jan 26 '18 at 11:44
  • 1
    However, if you are on Debian Stretch (which Beagleboard seems to be; or even Jessie), you should be using `systemd` instead of the old SysV init script facility. https://wiki.debian.org/systemd – tripleee Jan 26 '18 at 11:48

1 Answers1

0

Thanks tripleee. I solved the problem using systemd with this script.

[Unit]
Description= NoIp
After=multi-user.target

[Service]
Type=forking
ExecStart=/usr/local/bin/noip2

[Install]
WantedBy=multi-user.target