Red Hat Bugzilla – Bug 856724
cannot disable a service by systemctl - service started as dependency
Last modified: 2012-09-13 04:55:44 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.
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:
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)
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)