2

I wrote a simple .service for systemd. My process starts fine, but it spans more sub-processes with different PIDs.

Hence, I can not properly stop my service with the usual line:

ExecReload=/bin/kill -HUP $MAINPID

because I kill the main original process (a shell script), but not its children.

How can I kill 'em all on restart? Is there a valid macro like $ALLPIDS?

(I am working with Ubuntu 16.04.)

Thanks, F

Your Answer

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

Browse other questions tagged or ask your own question.