How do systemd and chkconfig interact with respect to services and runlevels

chkconfiginitservices

I recently updated some of our machines to Fedora 17. I have noticed that there are some services that I can configure their runlevels using chkconfig, while others don't appear there at all, and can be configured using systemctl.

For example, there are the similar commands chkconfig network off and systemctl disable NetworkManager.service. (I understand that network and NetworkManager are different, that's not the point.)

Why are some services configurable via one tool and not the other?

Does one tool replace the other? For example, runlevels are very obvious with chkconfig, but I can't even tell if that concept exists with systemd.

Edit: I found a table that maps calls from chkconfig to systemctl

Best Answer

From the fedora wiki page about systemd:

Does chkconfig command work with systemd?

Yes, for turning on/off services, compatibility has been provided both ways. chkconfig has been modified to call systemctl when dealing with systemd service files. Also systemctl automatically calls chkconfig when dealing with a traditional sysv init file.

This means you should be able to use either one of the tools for managing your services.

The concept of runlevels still exists, e.g (this is a Debian system):

ls -l runlevel*.target
lrwxrwxrwx 1 root root 15 Jun  5 22:57 runlevel0.target -> poweroff.target
lrwxrwxrwx 1 root root 13 Jun  5 22:57 runlevel1.target -> rescue.target
lrwxrwxrwx 1 root root 17 Jun  5 22:57 runlevel2.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jun  5 22:57 runlevel3.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jun  5 22:57 runlevel4.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jun  5 22:57 runlevel5.target -> multi-user.target
lrwxrwxrwx 1 root root 13 Jun  5 22:57 runlevel6.target -> reboot.target
Related Question