Systemd: service command not found
What can you do when the system answers to your commands with something like% sudo service postgresql stop
zsh: command not found: service
At glance, I thought there was some hidden problem with the
PATH
and sudo(1)
, but a quick search on the web shown me that, for some strange reasons, Fedora has a specific package named initscripts
that includes service
, so the command what effectively not installed on the system.
The solution was therefore as simple as:
% sudo yum install initscripts
I know that it is possible to interact with
systemctl
in a straight manner, so for instance the following are equivalent:
% sudo systemctl stop postgresql
% sudo service postgresql stop
service
be there and do the right thing depending on the service manager the operating system is using.