1

I have a systemd service file where ExecStartPost is used to start a long running process.

Is this process affected in any way by reload being called on the service (assuming ExecReload doesn't do anything related to that process)?

What about when stop is called?

Will calling start on a stopped service invoke the ExecStartPost commands again?

1 Answer 1

2

When you call start on the process these commands are executed

  • ExecStartPre Commands that will run before ExecStart.
  • ExecStart Main commands to run when starting the process.
  • ExecStartPost Commands that will run after all ExecStart commands have completed.

when you call stop you execute :

  • ExecStop Main commands to run when stopping the process.
  • ExecStopPost Commands that will run after ExecStop has completed.

And when you call reload:

  • ExecReload Commands will run

so to answer your questions

  • The process will not be affected when reload is called because ExecReload doesn't do anything related to that process.
  • when stop is called this process will be affected if this is specified in ExecStop or ExecStopPost commands
  • when start is called ExecStartPost will be invoked again
1
  • The answer could be improved by mentioning or linking to the official docs that the answer is sourced from. Commented Dec 1, 2016 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .