| chkconfig frobozz --list || ls /etc/systemd/system/*.wants/frobozz.service || Used to list what levels this service is configured on or off

| chkconfig frobozz --list || ls /etc/systemd/system/*.wants/frobozz.service || Used to list what levels this service is configured on or off

|-

|-

−

| chkconfig frobozz --level 12345 on || for target in rescue multi-user ; do ln -s /lib/systemd/system/frobozz.service /etc/systemd/system/$runlevel.target.wants/ && systemctl daemon-reload || Turn the service on for the next reboot. <ref group="nb" name="runlevel">In systemd, the numeric ''runlevels'' have been replaced by named ''targets''. The <code>graphical</code> target is a strict superset of the <code>multi-user</code> target so you don't have to set it up separately. The custom runlevels (2 and 4 in this example) are not defined well enough to have a real systemd equivalent; if you use them for custom runlevels, you should try a custom named ''target'' in systemd instead. See the [[#Runlevels/targets| Runlevels section]] for more details</ref>

+

| chkconfig frobozz --level 12345 on || for target in rescue multi-user ; do ln -s /lib/systemd/system/frobozz.service /etc/systemd/system/$target.target.wants/ && systemctl daemon-reload || Turn the service on for the next reboot. <ref group="nb" name="runlevel">In systemd, the numeric ''runlevels'' have been replaced by named ''targets''. The <code>graphical</code> target is a strict superset of the <code>multi-user</code> target so you don't have to set it up separately. The custom runlevels (2 and 4 in this example) are not defined well enough to have a real systemd equivalent; if you use them for custom runlevels, you should try a custom named ''target'' in systemd instead. See the [[#Runlevels/targets| Runlevels section]] for more details</ref>

|-

|-

−

| chkconfig frobozz --level 12345 off || for target in rescue multi-user ; do rm /etc/systemd/system/$runlevel.target.wants/frobozz.service && systemctl daemon-reload || Turn the service off for the next reboot. <ref group="nb" name="runlevel" />

+

| chkconfig frobozz --level 12345 off || for target in rescue multi-user ; do rm /etc/systemd/system/$target.target.wants/frobozz.service && systemctl daemon-reload || Turn the service off for the next reboot. <ref group="nb" name="runlevel" />

Additional commandsIn SysVinit, services can define arbitrary commands. Examples would be service iptables panic, or service httpd graceful. Native systemd services do not have this ability.

Any service that defines an additional command in this way would need to define some other, service-specific, way to accomplish this task when writing a native systemd service definition.

Check the package-specific release notes for any services that may have done this.

Notes

↑ 1.01.1In systemd, the numeric runlevels have been replaced by named targets. The graphical target is a strict superset of the multi-user target so you don't have to set it up separately. The custom runlevels (2 and 4 in this example) are not defined well enough to have a real systemd equivalent; if you use them for custom runlevels, you should try a custom named target in systemd instead. See the Runlevels section for more details

Runlevels/targets

Systemd has a concept of targets which serve a similar purpose as runlevels but act a little different. Each target is named instead of numbered and is intended to serve a specific purpose. Some targets are implemented by inheriting all of the services of another target and adding additional services to it. There are systemd targets that mimic the common SystemVinit runlevels so you can still switch targets using the familiar telinit RUNLEVEL command. The runlevels that are assigned a specific purpose on vanilla Fedora installs; 0, 1, 3, 5, and 6; have a 1:1 mapping with a specific systemd target. Unfortunately, there's no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named systemd target as /etc/systemd/system/$YOURTARGET that takes one of the existing runlevels as a base (you can look at /lib/systemd/system/graphical.target as an example), make a directory /etc/systemd/system/$YOURTARGET.wants, and then symlink the additional services that you want to enable into that directory. (The service unit files that you symlink live in /lib/systemd/system).

SystemVinit Runlevel

Systemd Target

Notes

0

runlevel0.target, poweroff.target

Halt the system.

1, s, single

runlevel1.target, rescue.target

Single user mode.

2, 4

runlevel2.target, runlevel4.target, multi-user.target

User-defined/Site-specific runlevels. By default, identical to 3.

3

runlevel3.target, multi-user.target

Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.

5

runlevel5.target, graphical.target

Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.