I have installed no-ip dynamic ddns following this guide: https://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/
I get the service running by
sudo /usr/local/bin/noip2
However I want the service to start on boot, I tried adding the following script to /etc/init.d/noip2.sh
#######################################################
#! /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."
killproc -TERM /usr/local/bin/noip2
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
#######################################################
Followed by:
sudo chmod +x /etc/init.d/noip2.sh
sudo update-rc.d noip2.sh defaults
Now I should be able to start the service with
sudo service noip2 start
But i'm not. When I run journalctl -xe
I get the following:
-- Unit noip2.service has begun starting up.
Nov 03 12:36:11 media systemd[3111]: noip2.service: Failed to execute command: Exec format error
Nov 03 12:36:11 media systemd[3111]: noip2.service: Failed at step EXEC spawning /etc/init.d/noip2.sh: Exec format error
-- Subject: Process /etc/init.d/noip2.sh could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The process /etc/init.d/noip2.sh could not be executed and failed.
--
-- The error number returned by this process is 8.
Nov 03 12:36:11 media systemd[1]: noip2.service: Control process exited, code=exited status=203
Nov 03 12:36:11 media systemd[1]: noip2.service: Failed with result 'exit-code'.
Nov 03 12:36:11 media systemd[1]: Failed to start noip2.service.
-- Subject: Unit noip2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
Updated info for user PerDuck: I get the following errors trying your solution... :( Tried adding
RestartSec=30
At least it keeps trying now but it still do not start. I can still start it with sudo /usr/local/bin/noip2
The errors:
Nov 03 23:26:42 media systemd[1]: noip2.service: Service hold-off time over, scheduling restart.
Nov 03 23:26:42 media systemd[1]: noip2.service: Scheduled restart job, restart counter is at 5.
Nov 03 23:26:42 media systemd[1]: Stopped noip2 service.
Nov 03 23:26:42 media systemd[1]: noip2.service: Start request repeated too quickly.
Nov 03 23:26:42 media systemd[1]: noip2.service: Failed with result 'start-limit-hit'.
Nov 03 23:26:42 media systemd[1]: Failed to start noip2 service.