I have HA cluster with samba running on the active node, now i get these error's in my root mail:
Can't find pid for destination 'smbd'
error: error running non-shared postrotate script for /var/log/samba/log.smbd of '/var/log/samba/log.smbd '
Can't find pid for destination 'nmbd'
error: error running non-shared postrotate script for /var/log/samba/log.nmbd of '/var/log/samba/log.nmbd '
run-parts: /etc/cron.daily/logrotate exited with return code 1
Can i make Logrotate only restart the service if it was running ?
As requested the logrotate config of smane
/var/log/samba/log.smbd {
weekly
missingok
rotate 7
postrotate
[ ! -x /usr/bin/smbcontrol ] || /usr/bin/smbcontrol smbd reload-config
endscript
compress
delaycompress
notifempty
}
/var/log/samba/log.nmbd {
weekly
missingok
rotate 7
postrotate
[ ! -x /usr/bin/smbcontrol ] || /usr/bin/smbcontrol nmbd reload-config
endscript
compress
delaycompress
notifempty
}
/var/log/samba/log.samba {
weekly
missingok
rotate 7
postrotate
if [ -d /run/systemd/system ] && command systemctl >/dev/null 2>&1 && systemctl is-active --quiet samba-ad-dc; then
systemctl kill --kill-who all --signal=SIGHUP samba-ad-dc
elif [ -f /var/run/samba/samba.pid ]; then
# This only sends to main pid, See #803924
kill -HUP `cat /var/run/samba/samba.pid`
fi
endscript
compress
delaycompress
notifempty
}