ralphlange / procServ

Wrapper to start arbitrary interactive commands in the background, with telnet or Unix domain socket access to stdin/stdout
GNU General Public License v3.0
23 stars 23 forks source link

Write pidfile of child in parent #45

Closed krisztianloki closed 3 years ago

krisztianloki commented 3 years ago

Avoids race condition if using a Type=forking systemd service

ralphlange commented 3 years ago

Looks reasonable. Do you see any chance of side effects? All UID changes and such must have happened before. Probably safe.

krisztianloki commented 3 years ago

I don't see any side effects. Basically witePifDFile() is just moved up one line into forkAndGo() (and into the parent process).