Ask Your Question
1

How to specify a service runlevel by using systemctl?

asked 2012-03-18 02:12:49 -0500

tiansworld gravatar image

Hi guys, I am using Fedora 16 x86_64. How can I specify a service runlevel by using systemctl?

For example, there is a service called FOO, I want it to run only in runlevel 3 and 5, How can I do this by using systemctl?

This can be done by chkconfig before:

chkconfig --level 35 FOO on
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2012-03-20 22:34:05 -0500

Akshay gravatar image

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)

edit flag offensive delete link more
1

answered 2012-03-18 11:09:32 -0500

FranciscoD_ gravatar image
edit flag offensive delete link more
0

answered 2012-03-18 11:55:16 -0500

Peter Scott gravatar image

chkconfig should still work. AFAIK that was part of the design aim for the new start up system. Have you tried it or are you trying to learn systemctl?

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-03-18 02:12:49 -0500

Seen: 2,757 times

Last updated: Mar 20 '12