Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
[dev.icinga.com #10935] Logrotate on systemd distros should use systemctl not service #3818
This issue has been migrated from Redmine: https://dev.icinga.com/issues/10935
Created by sysadmiral on 2016-01-06 11:37:50 +00:00
On a distro that uses systemd (in my case RHEL 7) the service command has been replaced with systemctl.
The logrotate commands for icinga2 use "service icinga2 status" but this generates lots of anacron "spam" because it gets redirected to systemctl.
Either the logrotate needs updating (for systemd systems only) to use systemctl or we need to /dev/null stderr for the "service icinga2 status" command. I am happy to create a pull request for the latter but I am unfamiliar with cmake and would not feel confident in setting up the logic for the first option.
If you need more info let me know.
2016-01-21 09:12:43 +00:00 by leeclemens 7bf012c
2016-02-23 08:27:30 +00:00 by leeclemens ea2aedb
Updated by jflach on 2016-01-07 08:50:51 +00:00
Using systemctl on systemd systems would be the right thing to do, but I too do not know how to do this elegantly.
So please go ahead and create a patch (git formated with a real sounding name) for redirecting stderr. :)
Updated by leeclemens on 2016-01-20 00:22:45 +00:00
Bringing discussion back here per @dnsmmichi:
I took a similar approach as syslog, sending USR1 signal and handling errors related to the pid file not being there (and not forcibly starting the service):