Re: [patch] rc.subr support for pidfile-based daemons

2018-06-02 Thread Theo de Raadt
IL Ka wrote: > > > > pid files can easily get out of sync with the expected process (example: > > daemon starts, writes a pid file, later it crashes. at any point between > > the crash and you trying to stop/restart the daemon another process > > could be assigned the same pid, then the wrong

Re: [patch] rc.subr support for pidfile-based daemons

2018-06-02 Thread IL Ka
> > pid files can easily get out of sync with the expected process (example: > daemon starts, writes a pid file, later it crashes. at any point between > the crash and you trying to stop/restart the daemon another process > could be assigned the same pid, then the wrong process is signalled). >

Re: [patch] rc.subr support for pidfile-based daemons

2018-06-02 Thread Stuart Henderson
On 2018/06/02 23:07, Il Ka wrote: > rc.subr(8) uses pgrep(1)/pkill(1) to control daemons > using their command lines. This is intentional. pid files can easily get out of sync with the expected process (example: daemon starts, writes a pid file, later it crashes. at any point between the crash

[patch] rc.subr support for pidfile-based daemons

2018-06-02 Thread Il Ka
Hello, rc.subr(8) uses pgrep(1)/pkill(1) to control daemons using their command lines. But in some cases it is more convenient to use pidfiles. Many services do so, inluding apache and postgresql. But not all services do have special tool for that. I run gunicorn (python wsgi server) that is