I have created systemd script - /etc/systemd/system/test123.service which inside is set to execute on start/stop the service in /etc/init.d/foo.sh with parameters start/stop,and foo.sh when started/stopped directly starts/stops the service The problem I face is, now I want to upgrade to systemd from init.d and when foo.sh is active ,the systemd script shows to be inactive via the command "systemctl status test123.service" .Is this behaviour expected or something can be changed in order systemd to see foo.sh status ?
-
You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132– JdeBPCommented Sep 13, 2018 at 12:13
-
I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.– 炸鱼薯条德里克Commented Sep 13, 2018 at 12:19
-
Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?– GordonCommented Sep 13, 2018 at 12:26
Add a comment
|
1 Answer
The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo
the service file must be called foo.service