Closed sbidy closed 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.
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?
service
is historically a wrapper for SysVinit scripts, but can also handle systemd unit files (at least at Fedora and RHEL, to be tested for other distributions)systemctl
is the standard command line tool for systemd unit filessysctl
has nothing to do with init stuffNot 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
$
I changed the postrotate command to service macromilter restart
.
Now it should work on Ubuntu/Debian and Fed./RHEL.
Error if logrotate script used with ubuntu:
and