Solved LightDM doesn't start automatically on boot

I deleted and re-installed FreeBSD on my laptop.
and I can't make LightDM start automatically on boot.
when I installed FreeBSD first time, I "accidentally" made it.
so I can't remember how I did it.

I added lightdm_enable="YES" at /etc/rc.conf but only blinks all black screen half a second and comes back to CLI.
so I made /etc/rc.d/lightdm file like this:
Code:
#!/bin/sh

. /etc/rc.subr

name="lightdm"
rcvar=${name}_enable
start_cmd="${name}_start"
stop_cmd=":"

lightdm_start()
{
        echo "Starting lightdm."
}

load_rc_config $name
run_rc_command "$1"
but this doesn't work either.

strangely, I can get into GUI by sudo lightdm start after logging in at CLI.
how can I start LightDM at boot?
 
I wasn't able to get that to start at boot either, but was able to start it from CLI. In the end I just gave up on it and used slim instead. I know that isn't helpful, but I can say slim works without issue.
 
OP: also, there was no need to "delete and reinstall" FreeBSD because unlike Linux, in FreeBSD, the OS is separate from xorg and a display manager. All you needed to do was follow the references and advice SirDice posted.
 
OP: also, there was no need to "delete and reinstall" FreeBSD because unlike Linux, in FreeBSD, the OS is separate from xorg and a display manager. All you needed to do was follow the references and advice SirDice posted.

I had to install Windows to update BIOS because .iso file provided by Lenovo didn't worked. so I had to use .exe file (also provided by Lenovo) to update it.
 
Remove it. There's a /usr/local/etc/rc.d/lightdm already installed.

Also make sure to read the pkg-message: pkg info -D lightdm

I don't know what went wrong, but I have no lightdm in /usr/local/etc/rc.d/
maybe reinstalling lightdm will solve this then. I will try it.
 
Remove it. There's a /usr/local/etc/rc.d/lightdm already installed.

Also make sure to read the pkg-message: pkg info -D lightdm

I don't know what went wrong, but I have no lightdm in /usr/local/etc/rc.d/
maybe reinstalling lightdm will solve this then. I will try it.

reinstalling lightdm did made file /usr/local/etc/rc.d/lightdm,
but it didn't solved the problem.

it still blinks a black screen and comes back to CLI.
I'm assuming that CLI login shell doesn't waits until LightDM starts.
when I was using 12.0-RELEASE, rarely CLI shell is too impetuous that LightDM was aborted while starting.
but on 12.1-RELEASE(on same machine), ALWAYS this happens.
 
I wasn't able to get that to start at boot either, but was able to start it from CLI. In the end I just gave up on it and used slim instead. I know that isn't helpful, but I can say slim works without issue.
SLiM is abandoned, so it may be vulnerable thus I'm uneasy about using it.
 
Maybe you forgot to re-add lightdm to the video group?
sadly, this doesn't work either.

when I removed to re-install LightDM, it said I have to remove lightdm user and lightdm group.
so I erased lightdm user but it said there was no lightdm group.
maybe this will be a clue.
 
I wrote exec /usr/local/bin/mate-session at ~/.xsession, but this don't work either.
when I login at CLI and typed exec /usr/local/bin/mate-session, It says:
Code:
Unable to init server: Could not connect to 127.0.0.1: Connection refused

** (mate-session: (number)): WARNING **: (something like IP address): Cannot open display:
but when I type sudo lightdm start, still it works fine.
 
If it works as root/sudo/su, but not as a normal user, then it's a problem with the permissions. That's why I mentioned the video group. ;D
But I use Openbox, I am of no help.
 
If your problem is caused by a memory allocation failure (see logs), the solution is:

Code:
sed -I "" "s/\(:memorylocked\)=128\(M:\)/\1=256\2/" /etc/login.conf
cap_mkdb /etc/login.conf
pw user mod -n lightdm -L daemon

There is a comment in /usr/local/etc/lightdm/lightdm.conf documenting this.
 
If it works as root/sudo/su, but not as a normal user, then it's a problem with the permissions. That's why I mentioned the video group. ;D
But I use Openbox, I am of no help.
when I run exec /usr/local/bin/mate-session at sudo, it says:
sudo: exec: command not found
and when I run at root, it says same as when I ran at my account.
 
If your problem is caused by a memory allocation failure (see logs), the solution is:

Code:
sed -I "" "s/\(:memorylocked\)=128\(M:\)/\1=256\2/" /etc/login.conf
cap_mkdb /etc/login.conf
pw user mod -n lightdm -L daemon

There is a comment in /usr/local/etc/lightdm/lightdm.conf documenting this.
this is my lightdm.log.
Code:
[+0.02s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.02s] DEBUG: Starting Light Display Manager 1.30.0, UID=0 PID=1266
[+0.02s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration dirs from /usr/local/etc/xdg/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration from /usr/local/etc/lightdm/lightdm.conf
[+0.02s] DEBUG: Registered seat module local
[+0.02s] DEBUG: Registered seat module xremote
[+0.02s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.27s] WARNING: Failed to get list of logind seats: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.login1 was not provided by any .service files
[+0.27s] DEBUG: Adding default seat
[+0.27s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.27s] DEBUG: Seat seat0: Starting
[+0.27s] DEBUG: Seat seat0: Creating greeter session
[+0.29s] DEBUG: Seat seat0: Creating display server of type x
[+0.32s] DEBUG: Could not run plymouth --ping: Failed to execute child process \xe2\x80\x9cplymouth\xe2\x80\x9d (No such file or directory)
[+0.32s] DEBUG: Using VT 9
[+0.32s] DEBUG: Seat seat0: Starting local X display on VT 9
[+0.32s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.34s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.38s] DEBUG: XServer 0: Launching X Server
[+0.38s] DEBUG: Launching process 1297: /usr/local/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt9 -novtswitch
[+0.38s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.38s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.38s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+1.93s] DEBUG: Loading users from org.freedesktop.Accounts
[+1.93s] DEBUG: User /org/freedesktop/Accounts/User1001 added
[+3.92s] DEBUG: Got signal 30 from process 1297
[+3.92s] DEBUG: XServer 0: Got signal from X server :0
[+3.92s] DEBUG: XServer 0: Connecting to XServer :0
[+3.96s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+3.96s] DEBUG: Session pid=1387: Started with service 'lightdm-greeter', username 'lightdm'
[+4.04s] DEBUG: Session pid=1387: Authentication complete with return value 0: Success
[+4.04s] DEBUG: Seat seat0: Session authenticated, running command
[+4.04s] DEBUG: Session pid=1387: Running command /usr/local/sbin/lightdm-gtk-greeter
[+4.04s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+4.04s] DEBUG: Session pid=1387: Logging to /var/log/lightdm/seat0-greeter.log
[+4.15s] DEBUG: Activating ConsoleKit session -1581072438.725849-974542565
[+5.56s] DEBUG: Greeter closed communication channel
[+5.56s] DEBUG: Session pid=1387: Exited with return value 1
[+5.56s] DEBUG: Seat seat0: Session stopped
[+5.56s] DEBUG: Seat seat0: Stopping; failed to start a greeter
[+5.56s] DEBUG: Seat seat0: Stopping
[+5.56s] DEBUG: Seat seat0: Stopping display server
[+5.56s] DEBUG: Sending signal 15 to process 1297
[+5.73s] DEBUG: Process 1297 terminated with signal 6
[+5.73s] DEBUG: XServer 0: X server stopped
[+5.73s] DEBUG: Releasing VT 9
[+5.73s] DEBUG: XServer 0: Removing X server authority /var/run/lightdm/root/:0
[+5.73s] DEBUG: Seat seat0: Display server stopped
[+5.73s] DEBUG: Seat seat0: Stopped
[+5.73s] DEBUG: Required seat has stopped
[+5.73s] DEBUG: Stopping display manager
[+5.73s] DEBUG: Display manager stopped
[+5.73s] DEBUG: Stopping daemon
[+5.74s] DEBUG: Exiting with return value 1
and this is my seat0-greeter.log.
Code:
** Message: 19:49:49.131: Starting lightdm-gtk-greeter 2.0.6 (Feb  1 2020, 15:46:40)
** Message: 19:49:49.132: [Configuration] Reading file: /usr/local/etc/lightdm/lightdm-gtk-greeter.conf

** (lightdm-gtk-greeter:1413): WARNING **: 19:49:50.216: [PIDs] Failed to execute command: /usr/lib/at-spi2-core/at-spi-bus-launcher

** (lightdm-gtk-greeter:1413): WARNING **: 19:49:50.246: [PIDs] Failed to execute command: upstart

(lightdm-gtk-greeter:1413): Gtk-WARNING **: 19:49:51.295: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node menubar owner GreeterMenuBar)

(lightdm-gtk-greeter:1413): Gtk-WARNING **: 19:49:55.253: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node menubar owner GreeterMenuBar)
so, it looks like memory allocation problem.
are your code is for typing in tcsh?
 
If your problem is caused by a memory allocation failure (see logs), the solution is:

Code:
sed -I "" "s/\(:memorylocked\)=128\(M:\)/\1=256\2/" /etc/login.conf
cap_mkdb /etc/login.conf
pw user mod -n lightdm -L daemon

There is a comment in /usr/local/etc/lightdm/lightdm.conf documenting this.
this is my lightdm.log.
Code:
[+0.02s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.02s] DEBUG: Starting Light Display Manager 1.30.0, UID=0 PID=1266
[+0.02s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration dirs from /usr/local/etc/xdg/lightdm/lightdm.conf.d
[+0.02s] DEBUG: Loading configuration from /usr/local/etc/lightdm/lightdm.conf
[+0.02s] DEBUG: Registered seat module local
[+0.02s] DEBUG: Registered seat module xremote
[+0.02s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.27s] WARNING: Failed to get list of logind seats: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.login1 was not provided by any .service files
[+0.27s] DEBUG: Adding default seat
[+0.27s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.27s] DEBUG: Seat seat0: Starting
[+0.27s] DEBUG: Seat seat0: Creating greeter session
[+0.29s] DEBUG: Seat seat0: Creating display server of type x
[+0.32s] DEBUG: Could not run plymouth --ping: Failed to execute child process \xe2\x80\x9cplymouth\xe2\x80\x9d (No such file or directory)
[+0.32s] DEBUG: Using VT 9
[+0.32s] DEBUG: Seat seat0: Starting local X display on VT 9
[+0.32s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.34s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.38s] DEBUG: XServer 0: Launching X Server
[+0.38s] DEBUG: Launching process 1297: /usr/local/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt9 -novtswitch
[+0.38s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.38s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.38s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+1.93s] DEBUG: Loading users from org.freedesktop.Accounts
[+1.93s] DEBUG: User /org/freedesktop/Accounts/User1001 added
[+3.92s] DEBUG: Got signal 30 from process 1297
[+3.92s] DEBUG: XServer 0: Got signal from X server :0
[+3.92s] DEBUG: XServer 0: Connecting to XServer :0
[+3.96s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+3.96s] DEBUG: Session pid=1387: Started with service 'lightdm-greeter', username 'lightdm'
[+4.04s] DEBUG: Session pid=1387: Authentication complete with return value 0: Success
[+4.04s] DEBUG: Seat seat0: Session authenticated, running command
[+4.04s] DEBUG: Session pid=1387: Running command /usr/local/sbin/lightdm-gtk-greeter
[+4.04s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+4.04s] DEBUG: Session pid=1387: Logging to /var/log/lightdm/seat0-greeter.log
[+4.15s] DEBUG: Activating ConsoleKit session -1581072438.725849-974542565
[+5.56s] DEBUG: Greeter closed communication channel
[+5.56s] DEBUG: Session pid=1387: Exited with return value 1
[+5.56s] DEBUG: Seat seat0: Session stopped
[+5.56s] DEBUG: Seat seat0: Stopping; failed to start a greeter
[+5.56s] DEBUG: Seat seat0: Stopping
[+5.56s] DEBUG: Seat seat0: Stopping display server
[+5.56s] DEBUG: Sending signal 15 to process 1297
[+5.73s] DEBUG: Process 1297 terminated with signal 6
[+5.73s] DEBUG: XServer 0: X server stopped
[+5.73s] DEBUG: Releasing VT 9
[+5.73s] DEBUG: XServer 0: Removing X server authority /var/run/lightdm/root/:0
[+5.73s] DEBUG: Seat seat0: Display server stopped
[+5.73s] DEBUG: Seat seat0: Stopped
[+5.73s] DEBUG: Required seat has stopped
[+5.73s] DEBUG: Stopping display manager
[+5.73s] DEBUG: Display manager stopped
[+5.73s] DEBUG: Stopping daemon
[+5.74s] DEBUG: Exiting with return value 1
and this is my seat0-greeter.log.
Code:
** Message: 19:49:49.131: Starting lightdm-gtk-greeter 2.0.6 (Feb  1 2020, 15:46:40)
** Message: 19:49:49.132: [Configuration] Reading file: /usr/local/etc/lightdm/lightdm-gtk-greeter.conf

** (lightdm-gtk-greeter:1413): WARNING **: 19:49:50.216: [PIDs] Failed to execute command: /usr/lib/at-spi2-core/at-spi-bus-launcher

** (lightdm-gtk-greeter:1413): WARNING **: 19:49:50.246: [PIDs] Failed to execute command: upstart

(lightdm-gtk-greeter:1413): Gtk-WARNING **: 19:49:51.295: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node menubar owner GreeterMenuBar)

(lightdm-gtk-greeter:1413): Gtk-WARNING **: 19:49:55.253: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node menubar owner GreeterMenuBar)
so, it looks like memory allocation problem.
are your code is for typing in tcsh?
Thanks! your answer solved it perfectly.
 
Back
Top