[solved] Need help trying to startup without lightdm

I have xorg-xinit package installed and would like to remove lightdm and startup without a display manager.
I have .xinitrc in my home dir (which I used on a previous arch install)
and the last line
exec dwm
but if I stop lightdm and then disable the service, then reboot, the computer just hangs on startup and I have to Ctrl+Alt+F2 then re-enable lightdm to get going again.
Any tips?

I switched to lxdm, as I recall you need to disable the lightdm greeter that’s in use as well - it’s not the usual lightdm-gtk-greeter.

this should giv you an idea of what’s enabled:

systemctl list-unit-files --state=enabled

There is also a systemctl command to switch to console boot - systemd commands

I think the:

systemctl isolate multi-user.target

is the command you want; verify that before you try it.

Arch Wiki - probably more current, looks like same command though.

^ That turns off the display manager but does not disable it permanently.

Try this instead:

systemctl set-default multi-user.target

I don’t know if ArchLabs requires any further measures but that works in my Arch box when I want to switch between GDM and a console log in.

EDIT: use this to enable the display manager again:

systemctl set-default graphical.target

Query the current state with systemctl get-default.

1 Like

ok I tried first stopping the lightdm service, then uninstalled the greeter
I set the target to mulit-user.target and rebooted but got the same stall on boot.
I had to re-install the greeter and re-enable the service to get back up and running.
I think I’ll throw in the towel unless anyone has any more great ideas.

I would keep lightdm.service installed and enabled, the custom .target should allow this but there must be something else going on in ArchLabs.

I think we will need the information requested earlier by @PackRat:

systemctl list-unit-files --state=enabled

And please don’t give up just yet, give the community a chance to respond.

here is what is running before I disable anything:
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
lightdm.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled

^ That should be fine, it matches my configuration:

empty@Xanadu:~ $ systemctl list-unit-files --state=enabled --no-pager                              
UNIT FILE                             STATE  
autovt@.service                       enabled
dbus-org.freedesktop.network1.service enabled
dbus-org.freedesktop.resolve1.service enabled
display-manager.service               enabled
gdm.service                           enabled
getty@.service                        enabled
nftables.service                      enabled
systemd-networkd-wait-online.service  enabled
systemd-networkd.service              enabled
systemd-resolved.service              enabled
systemd-timesyncd.service             enabled
unbound.service                       enabled
systemd-networkd.socket               enabled
remote-fs.target                      enabled
fstrim.timer                          enabled
roothints.timer                       enabled

16 unit files listed.
empty@Xanadu:~ $ systemctl get-default
multi-user.target
empty@Xanadu:~ $

^ That boots to a console login at the moment and will revert to GDM on the next boot if systemctl set-default graphical.target is issued.

What does systemctl get-default return on your box after a failed console boot?

Does the console boot still fail if lightdm.service & display-manager.service are enabled and the default is set to multi-user.target?

Does startx work from TTY2 (after a failed console boot)?

I think those commands need to be run with root privileges. Did you use sudo?

I assume you’d get an error message if you didn’t but I’ve never used them so don’t know for sure.

Hi, No console boot does not fail if the services are enabled and the defult is left on multi-user.target.
After a failed boot systemctl get-default give me multi-user
On TTY2 I can type startx or xinit and everything starts fine, I get Dwm (set at the moment in .xinitrc)
@ Packrat, yes I used sudo.

^ That’s your solution then :wink:

I think removing LightDM should obviate the need for multi-user.target but leaving it in place is fine.

I think I must have misunderstood, lol
If I don’t disable the lightdm service booting up does not fail, I get the lightdm greeter and choose what desktop manager, i3 dwm etc I want.
However I don’t want to use Lightdm I want rid of it for EVER! but yes lightdm still works with multi-user-target. If i disable lightdm I hve to go to TTY2 and login and its how I want it to work but on TTY1 with no lightdm.
OH BREAKING NEWS (not fake)
Solved it. by doing:

sudo systemctl edit getty@tty1 (it was empty so maybe i didn’t hve one!)
I pasted this into it

[Service]
ExecStart=
ExecStart=-/sbin/agetty --noclear %I $TERM

then I ran
sudo systemctl enable getty@tty1.service

1 Like

Hmmm… the “live” environment seems to work as expected:

2018-04-14-183119_1920x1080_scrot.th.png

Can anybody who actually has ArchLabs installed confirm the status of getty@tty1.service?

I cant remember when I installed Archlabs but it was months ago. I do remember on startup I didn’t get the welcome script and options it gives to install programs, so went into another TTy and navigated to /usr/bin/al-hello and ran the script from there but a few things were not right so it was probaly a bad intall from the start, however since then it’s been fine so I didn’t re-install.

How do we check that?

Run this command and compare the output with that shown in my screenshot above:

systemctl status getty@tty1

It should be listed as “active (running)”.

EDIT: you could also try:

systemctl isolate multi-user.target

and confirm that you see a console log in prompt on TTY1, thanks!

Okay, this is what I get:

systemctl status getty@tty1

 autologin@tty1.service - Getty on tty1
   Loaded: loaded (/etc/systemd/system/autologin@.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2018-04-15 06:28:40 NZST; 3h 2min ago
     Docs: man:agetty(8)
           man:systemd-getty-generator(8)
           http://0pointer.de/blog/projects/serial-console.html
 Main PID: 451 (login)
    Tasks: 0 (limit: 4915)
   Memory: 1.8M
   CGroup: /system.slice/system-autologin.slice/autologin@tty1.service
           ‣ 451 login -- dobbie

Apr 15 06:28:40 jarvis systemd[1]: Started Getty on tty1.
Apr 15 06:28:45 jarvis login[451]: pam_unix(login:session): session opened for user dobbie by LOGIN(uid=0)

systemctl isolate multi-user.target:

PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.

This command killed everything running.

^ I take it that’s an ArchLabs-specific unit file?

Ooops, sorry!

If you want to allow that command to work in ArchLabs then perhaps try disabling autologin@tty1.service and then enable getty@tty1.service and add this content to /etc/systemd/system/getty@tty1.service.d/override.conf:

ExecStart=
ExecStart=-/usr/bin/agetty --autologin $username --noclear %I $TERM

https://wiki.archlinux.org/index.php/Getty#Virtual_console

^ That should keep the autologin but still allow TTY1 to function as normal (I think).

EDIT: replace $username with your actual user name.

1 Like

I actually had the same issues archfan had - and also a blank getty@tty1.

Used his fix and now get:

getty@tty1.service - Getty on tty1
Loaded: loaded (/usr/lib/systemd/system/getty@.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/getty@tty1.service.d
└─override.conf
Active: active (running) since Sat 2018-04-14 19:45:22 EDT; 7min ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Main PID: 361 (login)
Tasks: 0 (limit: 2381)
Memory: 1.7M
CGroup: /system.slice/system-getty.slice/getty@tty1.service
‣ 361 login – doug

Can now login to dwm from console after boot.

1 Like