/etc/logrotate.d/zabbix-agent uses invoke-rc.d command, not in cron path

Bug #1772995 reported by Kartik Subbarao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zabbix (Ubuntu)
New
Undecided
Unassigned

Bug Description

/etc/logrotate.d/zabbix-agent has the following postrotate line:

[ -e /var/run/zabbix/zabbix_agentd.pid ] && invoke-rc.d zabbix-agent force-reload >/dev/null

There are a couple of issues with this:

1) When logrotate is invoked from cron, this doesn't work since invoke-rc.d (located in /usr/sbin) isn't in the default CRON path (/usr/bin:/bin).

2) invoke-rc.d uses the old-style init.d commands instead of systemd

I'd suggest the following fix:

[ -e /var/run/zabbix/zabbix_agentd.pid ] && systemctl restart zabbix-agent

systemctl is in /bin, which is in cron's path. Also, the command doesn't seem to generate any output so the output redirection can be removed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.