From an CentOS7 server, checking the file '/usr/lib/systemd/system/rspamd.service', I get the lines:
[Unit]
Description=rapid spam filtering system
After=nss-lookup.target network-online.target
[Service]
LimitNOFILE=1048576
NonBlocking=true
ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f
ExecReload=/bin/kill -HUP $MAINPID
User=_rspamd
RuntimeDirectory=rspamd
RuntimeDirectoryMode=0755
Restart=always
[Install]
WantedBy=multi-user.target
-----------------------------------------------------------------------------
Executing manualy the line "/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f", I get the following message:
-----------------------------------------------------------------------------
2018-03-14 06:20:00 #13107(main) <66d762>; main; detect_priv: cannot run rspamd workers as root user, please add -u and -g options to select a proper unprivilleged user or specify --insecure flag
-----------------------------------------------------------------------------
So, I try to change the 'rspamd.service' file with:
-----------------------------------------------------------------------------
(...)
ExecStart=/usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f
(...)
-----------------------------------------------------------------------------
I get the following in '/var/log/rspamd/rspamd.log' file:
-----------------------------------------------------------------------------
2018-03-14 05:51:20 #6320(main) <74322e>; main; main: rspamd 1.7.0 is starting, build id: release
2018-03-14 05:51:20 #6320(main) <74322e>; main; main: cpu features: avx2, avx, sse2, sse3, ssse3, sse4.1, sse4.2, rdrand
2018-03-14 05:51:20 #6320(main) <74322e>; main; main: cryptobox configuration: curve25519(avx), chacha20(avx2), poly1305(avx2), siphash(avx2), blake2(avx), base64(sse42)
2018-03-14 05:51:20 #6320(main) <74322e>; main; main: libottery prf: AES-128
2018-03-14 05:51:20 #6320(main) rspamd_file_lock: lock on file failed: Descritor de arquivo inválido
2018-03-14 05:51:20 #6320(main) <74322e>; main; main: cannot write pid file /var/run/rspamd/rspamd.pid
-----------------------------------------------------------------------------
So, seems there are a problem with '/var/run/rspamd/rspamd.pid' file.
But the directory '/var/run/rspamd/' doesn't exists.
I tried to create it, but at restarting the service (systemctl restart rspamd), this directory simply is removed again, and again, and again...
Someone had this problem with CentOS7 server..??!!
Regards.