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

Two improvements to handling pidfiles #27

Closed klemenv closed 5 years ago

klemenv commented 5 years ago

Before these two patches the pidfile would get written when procServ was daemonized (default), but not when in --foreground mode. When deamonized, pidfile would always get written even if no --pidfile option was specified, and the pid.txt was created in the current folder from where procServ binary was invoked. This is rarely a good choice especially when invoked from boot managers like systemd. Nevertheless, I've split the patch into two commits if you decide that dropping pid.txt is too invasive and breaks backward compatibility.