sbidy / MacroMilter

This python based milter (mail-filter) checks an incoming mail for suspicious VBA macro code in MS 20xx Office attachments (doc, xls, ppt ...).
MIT License
37 stars 14 forks source link

Error in macromilter.logrotate - ubuntu #21

Closed sbidy closed 6 years ago

sbidy commented 6 years ago

Error if logrotate script used with ubuntu:

logrotate_script: 2: logrotate_script: systemctl: not found
error: error running shared postrotate script for '/var/log/macromilter/macromilter.log'

and

sysctl: cannot stat /proc/sys/try-restart: No such file or directory
sysctl: cannot stat /proc/sys/macromilter/service: No such file or directory
error: error running shared postrotate script for '/var/log/macromilter/macromilter.log'
robert-scheck commented 6 years ago

Which version of Ubuntu is that? No systemctl sounds like an older Ubuntu. The second with sysctl is definately wrong. Does Ubuntu ship service by default? Then this could be likely used as wrapper for all, SysVinit, upstart and systemd.

sbidy commented 6 years ago

It is a (old) 14.04.1 Ubuntu and yes service is a default package. But I can't simply replace the systemctl with service.

Can we switch to a systemd command because it is more independent to distributions I guess?

robert-scheck commented 6 years ago

Not sure how it is for Ubuntu, but in Fedora and RHEL, the following works as expected transparently:

$ service macromilter restart
Redirecting to /bin/systemctl restart macromilter.service
$ 
sbidy commented 6 years ago

I changed the postrotate command to service macromilter restart. Now it should work on Ubuntu/Debian and Fed./RHEL.