1.7.3 (1.7.3-1~xenial)
Ubuntu 16.04 64bit
It no longer creates the PID file with the log saying,
main: skip writing pid in no-fork mode
even when specified in 'rspamd.conf' under 'options' -> 'pidfile'.
Start rspamd.
PID file should still be created when not forking.
PID file no longer gets created.
It became a problem as I could no longer monitor rspamd by checking on its PID file.
To get the PID file, systemd launch script has to be changed by taking '-f' option out of 'ExecStart' and add 'Type=forking'.
That was done to try simplify packaging AFAIU (on suggestion of people making efforts to package rspamd for Fedora). It's confusing that pidfile should not be honoured indeed.
You could get the PID from systemd:
~~~
systemctl -p MainPID show rspamd.service~~~
I have just discovered that in our production instance (on Debian stable) we cannot monitor the rspamd process anymore since this requires a PID file. I think at least if there is a pid file path configured, a PID file should be written. There are still tools that use it and backwards compatibility is not a bad thing. You can just disable writing a PID file in the config of a Fedora package, no need to remove the functionality.
I still would like to have PID file support as every time I update the rspamd package, it reverts the changes I made in systemd config file and the monitoring complains that the service cannot be found as no longer a PID file is written.
I do have options such as monitoring by process name or with the above 'export' command, write down the PID to a file in an interval but having an official PID file is the cleanest solution.
Agreed - having a PID file for systems like monit would be very useful.
Same problem here on Debian 10 buster, no way to monitor Rspamd with Monit..
Is it anyhow related to Rspamd? Are you using the packages that I provide?
I currently use : http://rspamd.com/apt-stable/ buster main
rspamd works like a charm except it do not generate pid file (which, as I said, making troubles for monitoring).
If you have any ideas, I am interested.
+1 on having a PID file for systems like monit
Edit: Potential workaround that I found - https://serverfault.com/questions/270316/monit-check-process-without-pidfile/285596#285596. I haven't tested this yet
Another way to work with monit without PID is a config like this :
check process rspamd
matching 'rspamd: main process'
start program = "/sbin/service rspamd start"
stop program = "/sbin/service rspamd stop"
if cpu is greater than 40% for 2 cycles then alert
if cpu > 60% for 5 cycles then alert
if memory > 80% for 4 cycles then alert
if totalmem > 512 MB for 5 cycles then alert
Works like a charm !
What is the status of this issue?
While the above comment's method works, finding a process by its name isn't the cleanest solution and I still would like to have a PID file generated.
Most helpful comment
Another way to work with monit without PID is a config like this :
Works like a charm !