0

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 – JdeBP Sep 13 '18 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. – 炸鱼薯条德里克 Sep 13 '18 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? – Gordon Sep 13 '18 at 12:26
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.