Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] systemd, masked services, and disabling lightdm
[SOLVED] systemd, masked services, and disabling lightdm
Hello all, my first time here.
Today I upgraded from Wheezy to Jessie. I cannot stop lightdm from loading at system boot.
My Wheezy setup was boot to a console login prompt, login, startx to go to Openbox plus tint2. Under Wheezy I had disabled lightdm and chosen Openbox as my x-session-manager instead of LXDE. After upgrade to Jessie lightdm had been re-enabled.
To disable lightdm I ran;
systemctl disable lightdm.service
which did not stop lightdm loading at boot. A bug report (#769796) suggested I also run;
systemctl disable display-manager.service
which did not stop lightdm loading either. Using "systemctl status" I noticed that these services had a status of "static". A bit of futher reading told me that "static" services cannot be disabled but they can be "masked" to render them impossible to start. I therefore executed;
systemctl mask display-manager.service
systemctl mask lightdm.service
You know what's coming, lightdm still started at system boot. Even more confusing, if I manually stop lightdm from within X, to get myself back to the console, I can still manually start lightdm, even though systemctl says the service is masked, and the systemd documentation I have looked at says a masked service cannot be started.
Can anybody explain the symptoms I am seeing? I simply want to login without a GUI, while the display manager is installed on the system, as I did under Wheezy.
Regards,
Martin.
Today I upgraded from Wheezy to Jessie. I cannot stop lightdm from loading at system boot.
My Wheezy setup was boot to a console login prompt, login, startx to go to Openbox plus tint2. Under Wheezy I had disabled lightdm and chosen Openbox as my x-session-manager instead of LXDE. After upgrade to Jessie lightdm had been re-enabled.
To disable lightdm I ran;
systemctl disable lightdm.service
which did not stop lightdm loading at boot. A bug report (#769796) suggested I also run;
systemctl disable display-manager.service
which did not stop lightdm loading either. Using "systemctl status" I noticed that these services had a status of "static". A bit of futher reading told me that "static" services cannot be disabled but they can be "masked" to render them impossible to start. I therefore executed;
systemctl mask display-manager.service
systemctl mask lightdm.service
You know what's coming, lightdm still started at system boot. Even more confusing, if I manually stop lightdm from within X, to get myself back to the console, I can still manually start lightdm, even though systemctl says the service is masked, and the systemd documentation I have looked at says a masked service cannot be started.
Can anybody explain the symptoms I am seeing? I simply want to login without a GUI, while the display manager is installed on the system, as I did under Wheezy.
Regards,
Martin.
Last edited by MartinK on 2015-05-15 20:55, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: systemd, masked services, and disabling lightdm
What is the output of:
I have encountered this before with GDM -- I think you just have to symlink /lib/systemd/system/lightdm.service to /dev/null manually (which is what `mask` is supposed to do but doesn't for some reason), but let's see the command output first.
This appears to be a Debian-specific bug (related to Debian's use of /etc/alternatives) rather than a systemd-specific one as my Arch system does not exhibit this behavior with display-manager.service
EDIT: Of course the simplest "solution" is to `apt-get purge lightdm` but that is less than ideal...
Code: Select all
ls -l /etc/systemd/system/display-manager.service
ls -l /lib/systemd/system/lightdm.service
This appears to be a Debian-specific bug (related to Debian's use of /etc/alternatives) rather than a systemd-specific one as my Arch system does not exhibit this behavior with display-manager.service
EDIT: Of course the simplest "solution" is to `apt-get purge lightdm` but that is less than ideal...
deadbang
Re: systemd, masked services, and disabling lightdm
Head_on_a_stick, you have saved my sanity.
Yes, I could have removed the lightdm package but I considered that a workaround, not a solution.
The commands you offered revealed;
as expected, but
looks like the culprit! For completness I also ran
I have not yet manually created a symlink to /dev/null for lightdm in /lib/systemd/system as I am guessing a future package upgrade will undo my work, so the question remains, what is the "proper way" to disable lightdm?
Martin.
p.s. (So easy under wheezy, just "update-rc.d lightdm disable")
Yes, I could have removed the lightdm package but I considered that a workaround, not a solution.
The commands you offered revealed;
Code: Select all
lrwxrwxrwx 1 root root 9 May 14 20:41 /etc/systemd/system/display-manager.service -> /dev/null
Code: Select all
-rw-r--r-- 1 root root 412 Sep 15 2014 /lib/systemd/system/lightdm.service
Code: Select all
ls -l /etc/systemd/system/lightdm.service
lrwxrwxrwx 1 root root 9 May 14 20:49 /etc/systemd/system/lightdm.service -> /dev/null
Martin.
p.s. (So easy under wheezy, just "update-rc.d lightdm disable")
Re: systemd, masked services, and disabling lightdm
You probably have the graphical target as default. If you don't want that, the "normal" thing to do would be to choose another default ("runlevel" in sysvinit-speak).MartinK wrote:Head_on_a_stick, you have saved my sanity.
Yes, I could have removed the lightdm package but I considered that a workaround, not a solution.
The commands you offered revealed;
as expected, butCode: Select all
lrwxrwxrwx 1 root root 9 May 14 20:41 /etc/systemd/system/display-manager.service -> /dev/null
looks like the culprit! For completness I also ranCode: Select all
-rw-r--r-- 1 root root 412 Sep 15 2014 /lib/systemd/system/lightdm.service
I have not yet manually created a symlink to /dev/null for lightdm in /lib/systemd/system as I am guessing a future package upgrade will undo my work, so the question remains, what is the "proper way" to disable lightdm?Code: Select all
ls -l /etc/systemd/system/lightdm.service lrwxrwxrwx 1 root root 9 May 14 20:49 /etc/systemd/system/lightdm.service -> /dev/null
Martin.
p.s. (So easy under wheezy, just "update-rc.d lightdm disable")
# systemctl set-default multi-user.target
This will (if things are properly configured) leave you at the console without a display manager.
(This is what I use as well, but I also don't have any display manager installed -- use startx -- so it might be that it also doesn't work)
Re: systemd, masked services, and disabling lightdm
Reinob,
You have hit the winning runs!
showed I was setup for the graphical target, as you assumed. I changed that to multi-user.target, re-booted and there I was at the login prompt, no GUI. After login startx took me to Openbox. That was all done with display-manager and lightdm services still masked.
I then unmasked display-manager and lightdm, re-booted, and everything still worked as I wanted. systemctl shows those services as "static", as originally, but "inactive".
It seems my mistake was to attempt what I did in system V init style boot, i.e. to disable the lightdm service.
The answer to how to disable lightdm in Jessie is actually - change the default target (run level). For clarity, that is;
Having searched on-line I know countless others are making the same mistake.
Thanks all,
Martin.
You have hit the winning runs!
Code: Select all
systemctl get-default
I then unmasked display-manager and lightdm, re-booted, and everything still worked as I wanted. systemctl shows those services as "static", as originally, but "inactive".
It seems my mistake was to attempt what I did in system V init style boot, i.e. to disable the lightdm service.
The answer to how to disable lightdm in Jessie is actually - change the default target (run level). For clarity, that is;
Code: Select all
systemctl set-default multi-user.target
Thanks all,
Martin.
Re: systemd, masked services, and disabling lightdm
Actually, the classical System V way would have been to define/select a suitable runlevel. It's just Debian & co. which made it unnecessarily complicated. In a way (and I'll be flamed), systemd brings back the logic in it :)MartinK wrote: It seems my mistake was to attempt what I did in system V init style boot, i.e. to disable the lightdm service.
Re: systemd, masked services, and disabling lightdm
Although I'm happily using Openbox without a full blown desktop environment I do sometimes run something like LXDE, for comparison.Bulkley wrote:Couldn't you simply remove Lightdm?
Re: systemd, masked services, and disabling lightdm
Me too.MartinK wrote:Although I'm happily using Openbox without a full blown desktop environment . . .
Ah. There is a CLI method to switch WMs. Sorry, I have forgotten how.. . . I do sometimes run something like LXDE, for comparison.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: systemd, masked services, and disabling lightdm
Bulkley wrote:There is a CLI method to switch WMs. Sorry, I have forgotten how.
Code: Select all
# update-alternatives --config x-window-manager
# update-alternatives --config x-session-manager
@OP: Please add "[SOLVED]" to the thread title for the benefit of others.
deadbang