How to restart a systemctl service from within the process
Karl Auer
kauer at biplane.com.au
Sun Nov 22 11:12:57 UTC 2020
On Sun, 2020-11-22 at 09:45 +0000, Colin Law wrote:
> I have a service (a nodejs process running node-red) and want it to
> self-restart. The obvious way appears to be to invoke
> systemctl restart theservice
Oh, to add to my previous response (sorry) I mean that to restart the
service from inside the service you simply exit the service, and let
systemd restart it. Not sure if the exit value is relevant.
> but I am concerned about the fact that the process running the
> systemctl command will itself be killed as part of the restart
Pretty sure it won't be. But if you discover that there is a problem,
do let us know :-)
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D
More information about the ubuntu-users
mailing list