You are not logged in.

#1 2019-03-03 11:27:10

i1yV
Member
Registered: 2018-04-21
Posts: 7

[SOLVED]Systemd: unable to mask service using kernel parameters

I'm trying to create GRUB menu options that will allow to skip launching GDM and, eventually, launch LightDM instead of GDM (so options for text-mode booting isn't a solution). I have added systemd.mask=gdm.service to kernel command line, like here, but GDM starts anyway.

Tried systemd.mask=gdm, it didn't help either.

Menu option is (formatted for readability):

    linux	/vmlinuz-linux root=/dev/mapper/vol-name rw
    cryptdevice=/dev/sda5:root 
    root=/dev/group/vol
    resume=/dev/mapper/swap-vol-name quiet 
    nvidia-drm.modeset=1
    module_blacklist=nvidia
    systemd.mask=gdm.service

systemd-debug-generator, which is responsible for parsing the option, is present in /usr/lib/systemd/system-generators.
What am I doing wrong?

Last edited by i1yV (2019-03-03 13:13:01)

Offline

#2 2019-03-03 11:37:25

ayekat
Member
Registered: 2011-01-17
Posts: 1,617

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

See https://wiki.archlinux.org/index.php/Sy … _boot_into.

I think it would be cleaner to just tell the kernel to explicitly boot only into multi-user.target instead of graphical.target, so that it won't even attempt to launch a DM (rather than fiddling around with masking).


pkgshackscfgblag

Offline

#3 2019-03-03 11:40:36

i1yV
Member
Registered: 2018-04-21
Posts: 7

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Yes, maybe. But, as I stated, I want to be able to choose login manager (gdm or lightdm) on boot, and masking looks like simplest method to do it. Maybe I should add different target instead, but that looks too hard. Also it looks useful to me to know method of disabling buggy service from GRUB menu

Offline

#4 2019-03-03 11:42:56

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,217
Website

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Don't do that. Rather create a custom systemd.target inheriting from graphical.target or multi-user.target that starts your alternative login manager.
You can edit the default target, at which the respective login manager starts by using:

systemctl edit <unit>

Last edited by schard (2019-03-03 11:45:07)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#5 2019-03-03 11:58:56

i1yV
Member
Registered: 2018-04-21
Posts: 7

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Ok, thanks, ayekat and schard, probably I will follow your advices, but is it possible to elaborate a bit why masking doesn't work? Was it removed from systemd? Or systemd-debug-generator isn't applied anymore?

Offline

#6 2019-03-03 12:02:58

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,217
Website

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Masking is still a feature in systemd, but it serves an entirely different purpose, namely, preventing from launching a unit ever under any circumstance.
However, you just don't want GDM to launch under a very specific condition, i.e. a specific system configuration aka. "runlevel" or, in systemd terms "target".
So this is the, in my opinion, obvious way to go.

Last edited by schard (2019-03-03 12:03:32)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#7 2019-03-03 12:10:07

i1yV
Member
Registered: 2018-04-21
Posts: 7

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

schard wrote:

Masking is still a feature in systemd

Yes, and I ask specifically about temporary masking using kernel parameter. Why doesn't it work? Where can I look up? Should I file a bug upstream?

Offline

#8 2019-03-03 12:20:05

loqs
Member
Registered: 2014-03-06
Posts: 18,393

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Display managers are a special case in that they are enabled under their own name and also under the shared name display-manager.service by

[Install]
Alias=display-manager.service

in their .service files
If you mask both services does gdm still start?

systemd.mask=gdm.service systemd.mask=display-manager.service

Offline

#9 2019-03-03 12:33:40

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,217
Website

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

I just tested it. You (only) need to mask the alias display-manager.service as which gdm is actually installed via its install section.
However this will most likely also mask lightdm.service, if it installs as display-manager.service as well (which it should).
Again: You're taking the wrong approach and use systemd's features for what they were not designed for.
Systemd-debug-generator is meant for debugging, not productive use or system configuration.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#10 2019-03-03 13:11:17

i1yV
Member
Registered: 2018-04-21
Posts: 7

Re: [SOLVED]Systemd: unable to mask service using kernel parameters

Thanks, loqs, schard, setting "systemd.mask=display-manager.service" worked for me. I didn't know about aliases (my bad) and this was the cause. Schard, probably you're right and this is not proper tool for the job, but I was concerned why it doesn't work at all.

Offline

Board footer

Powered by FluxBB