Bug 726881

Summary: systemctl enable ignores init levels
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: harald, johannbg, lpoetter, metherid, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-01 19:05:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nicolas Mailhot 2011-07-30 09:36:18 UTC
Description of problem:

systemctl enable ignores init levels

Version-Release number of selected component (if applicable):

$ rpm -qa systemd*|sort
systemd-30-1.fc16.x86_64
systemd-gtk-30-1.fc16.x86_64
systemd-sysv-30-1.fc16.x86_64
systemd-units-30-1.fc16.x86_64

How reproducible:

Always

Steps to Reproduce:
1. move to non default init level (for example single)
2. try to enable a new service
  
Actual results:

The service is enabled in default init level


Expected results:

The service is enabled in current init level

Comment 1 Lennart Poettering 2011-08-01 19:05:21 UTC
Hmm?

systemd does not support "init levels".

We do support "targets", of which multiple can be active at the same time. There is hence no such thing as "current target", since there are multiple.

"systemctl enable" enables a unit the way suggested in the [Install] section in the unit file, and independent of the current system state. If you want to manually hook in units in other targets, then do so manually by symlinking the unit file into a .wants/ directory of the target.

For example, bluetooth.service is by default started only if bluetooth.target is active. If you also want to start it when "multi-user.target" is active, then do:

mkdir -p /etc/systemd/system/multi-user.target.wants/
ln -sf /lib/systemd/system/bluetooth.service /etc/systemd/system/multi-user.target.wants/