0

I have a huuuge problem and need help. While trying to speed up the boot process on my LMDE4 machine by disabling/masking "unnecessary" services, I masked systemd-logind.service and can no longer boot. I've already tried booting into the console by editing the grub2 configuration, but the boot process interrupts with an error:

Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.

Press Enter to continue.

So I prepared a live LMDE4 USB stick, booted into the recovery system, unlocked and mounted the LUKS encrypted LVM host volume (the one I've locked myself out of), and now at least I have access to the file system.

How can I proceed from here to unmask the service unit on that volume?

The problem is that doing sudo systemctl unmask systemd-logind.service will unmask the service unit of the running USB recovery system and not the one on the host system. How does systemd recognize a service unit as masked? Is it something within the service file, i.e. can I just modify its content in order to unmask the service, or is it more involved?

I already checked file /lib/systemd/system/systemd-logind.service and it says

./systemd-logind.service: ASCII text

so it does not seem to be pointing to /dev/null (as usually happens when a service unit is masked by systemctl mask name.service).

1 Answer 1

0

Try to chroot into the System.

To do this open a terminal and run the following command

chroot YOURDRIVEMOUNTHERE

Replace YOURDRIVEMOUNTHERE with the Mount point where the broken System's Drive is Mounted.

Then check if /etc/systemd/system/systemd-logind.service is a symboilc link to /dev/null By running this command.

file /etc/systemd/system/systemd-logind.service

If it is run the following commands in the chroot bash shell.

rm  /etc/systemd/system/systemd-logind.service
ln -s /lib/systemd/system/systemd-logind.service /etc/systemd/system/systemd-logind.service

And try to boot Linux.

If it fails go back into the chroot bash shell and run

passwd root

And Set A Password. Boot into linux console and enter the password and run the following Command.

systemctl daemon-reload
systemctl enable systemd-logind.service

And Reboot

Afterwards you can disable access to the root account and only allow sudo root access if you want to by running

sudo passwd -l root
1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – DavidPostill
    Apr 4, 2021 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .