In Fedora we have 'systemctl' and 'service' scripts. It seems that service internally calls systemctl
. So what is the correct/right way on Fedora to start or stop services — via systemctl
or service
facility? May be there are nuances to keep in mind?
Fedora – service vs. systemctl scripts — which to use
fedorasystemd
Best Answer
The way to stop/start services in Fedora (later versions) is using
systemctl
.However, there may be a few services left in
/etc/init.d/
which you could control with theservice
command. You can still control them withsystemctl
assystemd
automatically maps them to unit files for you.For example, on my CentOS 7 (Fedora 19 or thereabouts), there is a
/etc/rc.d/init.d/network
script which I could control with theservice
command. If I usesystemctl
instead, it still works:As you can see, it has been mapped to
/etc/rc.d/init.d/network
bysystemd
and thesystemctl
command controls it.I could be so 'last year' and use
service
instead:Both work, but note that they do give different results in their
status
commands.