To the section as I just did in the snippet above. To tell systemd the unit is of type forking add the line Type=forking (By default, systemd restarts a process at most 5 times within 10 seconds or so before giving up and leaving it in failed state.) Hence, systemd tried to restart it over and over to no avail. That's why the init.d script and the systemd unit failed: They started noip2 just to see it immediately exits. when you start it, it creates another process that runs in background (so called forking) and the foreground process immediately returns (exits). Some research revealed the noip2 runs as a daemon, i.e. Systemctl disable -now $unit # disable and stop in one go You may also enable autostart and start the unit imediately or disable autostart and stop it at once: systemctl enable -now $unit # enable and start in one go Systemctl disable $unit # stops autostart (but doesn't stop the unit NOW) Systemctl enable $unit # starts a unit at boot time (but not NOW) Most of the time five commands are sufficient to control a units behaviour: systemctl start $unit # starts a unit NOW To disable autostart at boot time you must disable the unit: sudo systemctl disable noip2 To have the unit started at boot time you need to enable it: sudo systemctl enable noip2 Now you can try to start and stop your unit and see its status: sudo systemctl status noip2 To make systemd aware of the new unit ( systemd caches unit files and this command makes systemd reconsider its cache). I suggest switching from your init.d script to a systemd unit:Ĭreate the file /etc/systemd/system/rvice with the following content (and drop your init.d scripts): Since Ubuntu 15.04 the standard way to control background processes (and much, much more) is systemd. Nov 03 23:26:42 media systemd: Failed to start noip2 service. Nov 03 23:26:42 media systemd: rvice: Failed with result 'start-limit-hit'. Nov 03 23:26:42 media systemd: rvice: Start request repeated too quickly. Nov 03 23:26:42 media systemd: Stopped noip2 service. Nov 03 23:26:42 media systemd: rvice: Scheduled restart job, restart counter is at 5. The errors: Nov 03 23:26:42 media systemd: rvice: Service hold-off time over, scheduling restart. I can still start it with sudo /usr/local/bin/noip2 :(Īt least it keeps trying now but it still do not start. I get the following errors trying your solution. Nov 03 12:36:11 media systemd: Failed to start rvice. Nov 03 12:36:11 media systemd: rvice: Failed with result 'exit-code'. Nov 03 12:36:11 media systemd: rvice: Control process exited, code=exited status=203 The error number returned by this process is 8. The process /etc/init.d/noip2.sh could not be executed and failed. Subject: Process /etc/init.d/noip2.sh could not be executed Nov 03 12:36:11 media systemd: rvice: Failed at step EXEC spawning /etc/init.d/noip2.sh: Exec format error Nov 03 12:36:11 media systemd: rvice: Failed to execute command: Exec format error When I run journalctl -xe I get the following: - Unit rvice has begun starting up. Now I should be able to start the service with sudo service noip2 startīut i'm not. etc/rc.d/init.d/functions # uncomment/modify for your killprocįollowed by: sudo chmod +x /etc/init.d/noip2.sh However I want the service to start on boot, I tried adding the following script to /etc/init.d/noip2.sh # I get the service running by sudo /usr/local/bin/noip2 I have installed no-ip dynamic ddns following this guide:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |