Bug 856724 - cannot disable a service by systemctl - service started as dependency
cannot disable a service by systemctl - service started as dependency
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-09-12 12:10 EDT by hramrach
Modified: 2012-09-13 04:55 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-09-13 04:55:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description hramrach 2012-09-12 12:10:48 EDT
Disabling the display manager in fedora is quite difficult excerscise.

First it is required to figure out that display manager is handled by prefdm.service. Quite obscure name but listing the services and staring at them for a while should suffice.

Now it is possible to stop prefdm but disablin it has no effect. systemctl will happily disable it. Or perhaps not, it does not print any links have been removed but how shoul I know that not printing something I have never seen printed is supposed to be an issue? Either way, it starts at boot anyway.

Disabling the graphical.target which probably depends on prefdm (or at least logically should) has no effect either. At least looking up graphical.target reveals it to be special systemd target. And reading more on special target reveals that graphical.target or multi-user.target tends to be linked to default.target which is what systemd executes on boot.

Changing the symlink (there does not seem to be command for that) solves the issue. So would probably mask command of systemctl.

Now the question is how is anybody supposed to know that? The administration guide tells you to use 'systemctl disable service' and systemctl does not tell you that prefdm is an unlisted(!) dependency of the graphical.target which is linked to default.
Comment 1 Bill Nottingham 2012-09-12 15:32:40 EDT
I'm unsure, exactly, what you are requesting here.

If you want to generally disable a service that has been enabled by a script or by the administrator, use 'systemctl disable <foo>.service'.

If you want to mask a service, such that it isn't run even if it's enabled or brought in by a dependency, use 'systemctl mask <foo>.service.'

prefdm is a special case in that it's tied into graphical.target (which is akin to the old 'runlevel 5' in the pre-systemd world.) If you don't want a display manager at all, the simplest thing to do, as you suggest, is to switch the default target to 'multi-user.target'.

For more information in general, see:
Comment 2 Bill Nottingham 2012-09-12 15:33:35 EDT
Note that the mechanism for how display managers are started changes in F-18; each has their own service file, and prefdm itself isn't used. (http://fedoraproject.org/wiki/Features/DisplayManagerRework has details)
Comment 3 Lennart Poettering 2012-09-13 04:55:44 EDT
On F18 you can "systemctl disable" your dm and the right thing will happen. Hence closing NEXTRELEASE.

(Also, even if we still had prefdm.service and you tried to disable that on F18 you'd now get a nice message telling you that the service is not one you disable/enable)

Note You need to log in before you can comment on or make changes to this bug.