Logrotate script error under systemd distributions

I upgrade urbackup-server 2.4.x to 2.5.33 and got log rotate error. I check the new log rotate script is

 test -e /var/run/urbackupsrv.pid && kill -HUP `cat /var/run/urbackupsrv.pid` || test -e /var/run/urbackupsrv.ready && /bin/systemctl kill -s HUP --kill-who=main urbackup-server.service

however urbackupsrv didn’t create “urbackupsrv.pid” or “urbackupsrv.ready” by default.

old 2.4.x script was working fine. it was below

test -e /var/run/urbackupsrv.pid && kill -HUP `cat /var/run/urbackupsrv.pid` || /bin/systemctl kill -s HUP urbackup-server.service

so the logrotate script need to fixed. or the default systemd unit should be modified to start urbackup-server with “–pidfile” to create the pid file.

Will remove that bit again.

The problem is that I had this run once before it installed the SIGHUP handler once which killed the server on startup.

Won’t since the file gets created in 2.5.x: urbackup_backend/main.cpp at 2.5.x · uroni/urbackup_backend · GitHub

So something else is going wrong on your end.

by default urbackupsrv will run as “urbackup” user. I don’t know if urbackup will write to “/var/run/urbackup.ready” before dropping privilege. it seems can not create the file under fedora/RHEL.

normally service will create their own directory with correct permission (eg: /var/run/urbackup/urbackup.ready").