Bug 856724 - cannot disable a service by systemctl - service started as dependency
Summary: cannot disable a service by systemctl - service started as dependency
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-12 16:10 UTC by hramrach
Modified: 2012-09-13 08:55 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-13 08:55:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description hramrach 2012-09-12 16:10:48 UTC
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 19:32:40 UTC
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:
  http://0pointer.de/blog/projects/three-levels-of-off.html

Comment 2 Bill Nottingham 2012-09-12 19:33:35 UTC
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 08:55:44 UTC
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.