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 the service
command. You can still control them with systemctl
as systemd
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 the service
command. If I use systemctl
instead, it still works:
# sudo systemctl status network
network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network)
Active: active (exited) since Tue 2014-11-11 08:21:51 GMT; 2 weeks 1 days ago
As you can see, it has been mapped to /etc/rc.d/init.d/network
by systemd
and the systemctl
command controls it.
I could be so 'last year' and use service
instead:
# service network status
Configured devices:
lo eth0
Currently active devices:
lo eth0 tun0
Both work, but note that they do give different results in their status
commands.
In my case, I was placing my systemd unit files directly under /etc/systemd/system/...
folders. Moved them to /lib/systemd/system
instead and that resolved the issue with systemctl enable/disable commands.
Best Answer
It makes the unit start on first login of a user, but for that corresponding unit file should have
WantedBy = default.target
or something along the lines. Because when user instance ofsystemd
starts, it brings up thedefault.target
target.