[Solved] Why lightdm is trying to run a script that is somewhere else?

Hi,

I wonder where in lightdm config is an instruction to run CDSPremote.py This file does exist in ~/bin but was never meant to be run by lightdm, particularly so early in the boot sequence. Here’s the context. Look for the line containing ‘python’

System is Fedora 44 workstation witn ciinnamon desktop and lightdm as greeter. Kernel 7.2.8

$ journalctl --no-pager --no-hostname -b | grep -C 30 pyth
oct 01 07:57:34 systemd[2233]: Reached target basic.target - Basic System.
oct 01 07:57:34 systemd[2233]: Reached target default.target - Main User Target.
oct 01 07:57:34 systemd[2233]: Startup finished in 164ms.
oct 01 07:57:34 systemd[1]: Started user@1000.service - User Manager for UID 1000.
oct 01 07:57:34 systemd[1]: Startup finished in 3.059s (kernel) + 13.195s (initrd) + 13.684s (userspace) = 29.939s.
oct 01 07:57:34 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user@1000 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 63 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 63 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 71 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 71 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 61 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 61 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 68 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 68 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 66 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 66 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 64 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 64 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 72 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 72 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 62 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 62 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 70 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 70 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 69 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 69 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 67 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 67 affinity is now unmanaged
oct 01 07:57:35 irqbalance[1389]: Cannot change IRQ 65 affinity: Permission denied
oct 01 07:57:35 irqbalance[1389]: IRQ 65 affinity is now unmanaged
oct 01 07:57:35 lightdm[2307]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
oct 01 07:57:35 audit[2300]: AUDIT1103 pid=2300 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_env,pam_permit acct="lightdm" exe="/usr/bin/lightdm" hostname=? addr=? terminal=:0 res=success'
oct 01 07:57:35 lightdm[2300]: pam_unix(lightdm-greeter:session): session opened for user lightdm(uid=975) by (uid=0)
oct 01 07:57:35 systemd-logind[1407]: New session 'c1' of user 'lightdm' with class 'greeter' and type 'x11'.
oct 01 07:57:35 systemd[1]: Created slice user-975.slice - User Slice of UID 975.
oct 01 07:57:35 systemd[1]: Starting user-runtime-dir@975.service - User Runtime Directory /run/user/975...
oct 01 07:57:35 systemd[2233]: Reached target sound.target - Sound Card.
oct 01 07:57:35 systemd[1]: Finished user-runtime-dir@975.service - User Runtime Directory /run/user/975.
oct 01 07:57:35 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user-runtime-dir@975 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
oct 01 07:57:35 systemd[1]: Starting user@975.service - User Manager for UID 975...
oct 01 07:57:35 audit[2332]: AUDIT1101 pid=2332 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_unix acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=success'
oct 01 07:57:35 audit[2332]: AUDIT1103 pid=2332 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=? acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=failed'
oct 01 07:57:35 systemd-logind[1407]: New session '2' of user 'lightdm' with class 'manager-early' and type 'unspecified'.
oct 01 07:57:35 (systemd)[2332]: pam_unix(systemd-user:session): session opened for user lightdm(uid=975) by lightdm(uid=0)
oct 01 07:57:35 audit[2332]: AUDIT1105 pid=2332 uid=0 auid=975 ses=2 msg='op=PAM:session_open grantors=pam_selinux,pam_selinux,pam_loginuid,pam_keyinit,pam_namespace,pam_systemd_home,pam_umask,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=success'
oct 01 07:57:35 uresourced[1510]: Setting resources on user.slice (MemoryMin: 262144000, MemoryLow: 0, CPUWeight: -, IOWeight: -)
oct 01 07:57:35 uresourced[1510]: Setting resources on user-975.slice (MemoryMin: 262144000, MemoryLow: 0, CPUWeight: 500, IOWeight: 500)
oct 01 07:57:35 uresourced[1510]: Setting resources on user@975.service (MemoryMin: 0, MemoryLow: 0, CPUWeight: 100, IOWeight: 100)
oct 01 07:57:35 (udev-worker)[2207]: sr0: Process '/usr/sbin/pktsetup -i -d 11:0' failed with exit code 1.
oct 01 07:57:35 systemd[2332]: Queued start job for default target default.target.
oct 01 07:57:35 systemd[2332]: Created slice app.slice - User Application Slice.
oct 01 07:57:35 systemd[2332]: grub-boot-success.timer - Mark boot as successful after the user session has run 2 minutes skipped, unmet condition check ConditionUser=!@system
oct 01 07:57:35 systemd[2332]: Started systemd-tmpfiles-clean.timer - Daily Cleanup of User's Temporary Directories.
oct 01 07:57:35 systemd[2332]: Reached target paths.target - Paths.
oct 01 07:57:35 systemd[2332]: Reached target timers.target - Timers.
oct 01 07:57:35 systemd[2332]: Starting dbus.socket - D-Bus User Message Bus Socket...
oct 01 07:57:35 systemd[2332]: Listening on pipewire-pulse.socket - PipeWire PulseAudio.
oct 01 07:57:35 systemd[2332]: Listening on pipewire.socket - PipeWire Multimedia System Sockets.
oct 01 07:57:35 systemd[2332]: Listening on systemd-ask-password.socket - Query the User Interactively for a Password.
oct 01 07:57:35 systemd[2332]: Listening on systemd-importd.socket - Disk Image Download Service Socket.
oct 01 07:57:35 systemd[2332]: Listening on systemd-machined.socket - Virtual Machine and Container Registration Service Socket.

Are you sure that SELinux is not blocking the operation by verifying its status with getenforce or temporarily setting it to permissive mode to test if the errors cease.

If the service fails to start or run correctly after applying changes, restart the daemon using systemctl restart irqbalance.

Some users disable the kernel tunable protection for the irqbalance service by creating an override configuration file (e.g., /etc/systemd/system/irqbalance.service.d/override.conf) with the following content:

[Service]
ProtectKernelTunables=no

It isn’t, it’s something you added.

Seems you spotted a problem there. Thank you for this. I added the override. Will see what happens at next boot.

$ sudo systemctl status irqbalance 

[sudo] Mot de passe de shizuma : 
● irqbalance.service - irqbalance daemon
     Loaded: loaded (/usr/lib/systemd/system/irqbalance.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Thu 2026-10-01 07:57:24 EDT; 8h ago
 Invocation: 252cbbc4b66746f69377743ce6b448ea
       Docs: man:irqbalance(1)
             https://github.com/Irqbalance/irqbalance
   Main PID: 1389 (irqbalance)
      Tasks: 2 (limit: 33449)
     Memory: 1.3M (peak: 2.3M)
        CPU: 751ms
     CGroup: /system.slice/irqbalance.service
             └─1389 /usr/sbin/irqbalance

oct 01 07:57:35 shizuma irqbalance[1389]: Cannot change IRQ 62 affinity: Permission denied
oct 01 07:57:35 shizuma irqbalance[1389]: IRQ 62 affinity is now unmanaged
oct 01 07:57:35 shizuma irqbalance[1389]: Cannot change IRQ 70 affinity: Permission denied
oct 01 07:57:35 shizuma irqbalance[1389]: IRQ 70 affinity is now unmanaged
oct 01 07:57:35 shizuma irqbalance[1389]: Cannot change IRQ 69 affinity: Permission denied
oct 01 07:57:35 shizuma irqbalance[1389]: IRQ 69 affinity is now unmanaged
oct 01 07:57:35 shizuma irqbalance[1389]: Cannot change IRQ 67 affinity: Permission denied
oct 01 07:57:35 shizuma irqbalance[1389]: IRQ 67 affinity is now unmanaged
oct 01 07:57:35 shizuma irqbalance[1389]: Cannot change IRQ 65 affinity: Permission denied
oct 01 07:57:35 shizuma irqbalance[1389]: IRQ 65 affinity is now unmanaged
$ sudo micro /etc/systemd/system/irqbalance.service.d/override.conf
$ sudo systemctl restart irqbalance
$ sudo systemctl status irqbalance
● irqbalance.service - irqbalance daemon
     Loaded: loaded (/usr/lib/systemd/system/irqbalance.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
             /etc/systemd/system/irqbalance.service.d
             └─override.conf
     Active: active (running) since Thu 2026-10-01 16:13:49 EDT; 5s ago
 Invocation: 0a6b7c0c73284d9fb8412fe89a39ca01
       Docs: man:irqbalance(1)
             https://github.com/Irqbalance/irqbalance
   Main PID: 284584 (irqbalance)
      Tasks: 2 (limit: 33449)
     Memory: 1.1M (peak: 2.5M)
        CPU: 37ms
     CGroup: /system.slice/irqbalance.service
             └─284584 /usr/sbin/irqbalance

oct 01 16:13:49 shizuma systemd[1]: Started irqbalance.service - irqbalance daemon.
oct 01 16:13:49 shizuma irqbalance[284584]: thermal: failed to receive messages.
oct 01 16:13:49 shizuma irqbalance[284584]: Failed to initialize thermal events.

SELinux is disabled since Fedora 38. My choice,

@leigh123linux That is correct. I added it for my personal usage. That’s why it’s in ~/bin. Why lightdm is trying to start it is what I would like to understand, to stop this from happening,

It was handled by cinnamon before I change gdm for lightdm (Xorg support) last june. I probably made a config file I cannot retrace, not being ultra familiar with lightdm config.

jui 28 15:45:46 lightdm[2336]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
jui 28 18:00:52 lightdm[2303]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
jui 28 18:19:11 lightdm[2654]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
jui 28 18:50:53 lightdm[2316]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
jui 29 07:48:26 lightdm[2363]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
(...)
sep 25 08:38:04 lightdm[2340]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
sep 26 09:48:55 lightdm[2279]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
sep 27 09:34:57 lightdm[3888]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
sep 28 03:10:32 lightdm[2332]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
sep 30 08:22:18 lightdm[2370]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory
oct 01 07:57:35 lightdm[2307]: python: can't open file '/var/lib/lightdm/bin/CDSPremote.py': [Errno 2] No such file or directory

you could check something like:
sudo grep -r CDSPremote.py /etc

and see if it’s stuck in a config file somewhere?
you could do the same and poke around in home.

Hi,

Thanks for your reply. That is a very good idea. Unfortunately, all instances found are legit.

Could it be in the following where it cannot interpret the ‘~’ in /home/shizuma/bin/pc.sh on the python line?

# cat /etc/lightdm/lightdm.conf.d/55-init.conf 
[Seat:*]
greeter-session=lightdm-gtk-greeter
greeter-setup-script=/usr/local/sbin/monitor-init.sh

# cat /usr/local/sbin/monitor-init.sh
#!/bin/sh
bash /home/shizuma/bin/pc.sh
/usr/bin/numlockx on

# cat /home/shizuma/bin/pc.sh
#!/bin/bash
#pc
xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal --output DisplayPort-1 --off --output HDMI-A-0 --off
python ~/bin/CDSPremote.py -c 90deg-D1.yml

Yes, you should try putting the whole path there.

I’m pretty certain that @grumpey suggestion should work.

@josevillani Mine is very close to the same readings:

❯ systemctl status irqbalance 
● irqbalance.service - irqbalance daemon
     Loaded: loaded (/usr/lib/systemd/system/irqbalance.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
             /etc/systemd/system/irqbalance.service.d
             └─override.conf
     Active: active (running) since Thu 2026-10-01 15:40:50 MDT; 2min 55s ago
 Invocation: 86f5a5089f294b9a85391b980fc959fe
       Docs: man:irqbalance(1)
             https://github.com/Irqbalance/irqbalance
   Main PID: 373690 (irqbalance)
      Tasks: 2 (limit: 18795)
     Memory: 1.2M (peak: 4.8M)
        CPU: 60ms
     CGroup: /system.slice/irqbalance.service
             └─373690 /usr/sbin/irqbalance

Oct 01 15:41:00 fedora irqbalance[373690]: Cannot change IRQ 80 affinity: Permission denied
Oct 01 15:41:00 fedora irqbalance[373690]: IRQ 80 affinity is now unmanaged
Oct 01 15:41:00 fedora irqbalance[373690]: Cannot change IRQ 79 affinity: Permission denied
Oct 01 15:41:00 fedora irqbalance[373690]: IRQ 79 affinity is now unmanaged
Oct 01 15:41:00 fedora irqbalance[373690]: Cannot change IRQ 87 affinity: Permission denied
Oct 01 15:41:00 fedora irqbalance[373690]: IRQ 87 affinity is now unmanaged
Oct 01 15:41:00 fedora irqbalance[373690]: Cannot change IRQ 77 affinity: Permission denied
Oct 01 15:41:00 fedora irqbalance[373690]: IRQ 77 affinity is now unmanaged
Oct 01 15:41:00 fedora irqbalance[373690]: Cannot change IRQ 85 affinity: Permission denied
Oct 01 15:41:00 fedora irqbalance[373690]: IRQ 85 affinity is now unmanaged

░▒▓ 󰣛  ~   15:44  
❯ sudo dmesg|rg IRQ
[    0.090341] NR_IRQS: 524544, nr_irqs: 1064, preallocated irqs: 16
[    0.360500] ACPI: PCI: Interrupt link LNKA configured for IRQ 0
[    0.360600] ACPI: PCI: Interrupt link LNKB configured for IRQ 0
[    0.360678] ACPI: PCI: Interrupt link LNKC configured for IRQ 0
[    0.360774] ACPI: PCI: Interrupt link LNKD configured for IRQ 0
[    0.360865] ACPI: PCI: Interrupt link LNKE configured for IRQ 0
[    0.360938] ACPI: PCI: Interrupt link LNKF configured for IRQ 0
[    0.361012] ACPI: PCI: Interrupt link LNKG configured for IRQ 0
[    0.361084] ACPI: PCI: Interrupt link LNKH configured for IRQ 0
[    0.375313] PCI: Using ACPI for IRQ routing
[    0.378067] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.730493] pcieport 0000:00:01.1: PME: Signaling with IRQ 28
[    0.730653] pcieport 0000:00:01.2: PME: Signaling with IRQ 29
[    0.730800] pcieport 0000:00:02.1: PME: Signaling with IRQ 30
[    0.730940] pcieport 0000:00:02.2: PME: Signaling with IRQ 31
[    0.731074] pcieport 0000:00:02.4: PME: Signaling with IRQ 32
[    0.731221] pcieport 0000:00:08.1: PME: Signaling with IRQ 33
[    0.731484] pcieport 0000:00:08.2: PME: Signaling with IRQ 34
[    0.736179] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    6.219029] r8169 0000:03:00.0 eth0: RTL8168h/8111h, 9c:2d:cd:15:0b:65, XID 541, IRQ 89

After next boot, no difference whatsoever with irqbalance than before.

@grumpey Right, with the whole path, we’re progressing. It finds the script. However, it complains that a module is not found. But the module is exactly where it should be, in ~/.local/lib/python3.14/site-packages/camilladsp and runs perfectly from the command line.

$ ll .local/lib/python3.14/site-packages/camilladsp
total 80K
drwxrwxr-x 3 shizuma shizuma 4,0K 30 mai 21:00 .
drwxrwxr-x 6 shizuma shizuma 4,0K 30 mai 21:00 ..
-rw-rw-r-- 1 shizuma shizuma 3,0K 30 mai 21:00 camilladsp.py
-rw-rw-r-- 1 shizuma shizuma 4,0K 30 mai 21:00 camillaws.py
-rw-rw-r-- 1 shizuma shizuma  335 30 mai 21:00 commandgroup.py
-rw-rw-r-- 1 shizuma shizuma 7,7K 30 mai 21:00 config.py
-rw-rw-r-- 1 shizuma shizuma 3,7K 30 mai 21:00 datastructures.py
-rw-rw-r-- 1 shizuma shizuma 2,3K 30 mai 21:00 exceptions.py
-rw-rw-r-- 1 shizuma shizuma 3,7K 30 mai 21:00 general.py
-rw-rw-r-- 1 shizuma shizuma  477 30 mai 21:00 __init__.py
-rw-rw-r-- 1 shizuma shizuma 7,3K 30 mai 21:00 levels.py
drwxrwxr-x 2 shizuma shizuma 4,0K 30 mai 21:00 __pycache__
-rw-rw-r-- 1 shizuma shizuma 1,1K 30 mai 21:00 ratemonitor.py
-rw-rw-r-- 1 shizuma shizuma  721 30 mai 21:00 settings.py
-rw-rw-r-- 1 shizuma shizuma 1,5K 30 mai 21:00 status.py
-rw-rw-r-- 1 shizuma shizuma  938 30 mai 21:00 versions.py
-rw-rw-r-- 1 shizuma shizuma 5,8K 30 mai 21:00 volume.py

I’d be very happy to have that fixed.

$ journalctl --no-pager --no-hostname -b |grep 04:54:53
oct 02 04:54:53 python[2344]: detected unhandled Python exception in '/home/shizuma/bin/CDSPremote.py'
oct 02 04:54:53 lightdm[2344]: Traceback (most recent call last):
oct 02 04:54:53 lightdm[2344]:   File "/home/shizuma/bin/CDSPremote.py", line 7, in <module>
oct 02 04:54:53 lightdm[2344]:     from camilladsp import CamillaClient, CamillaError
oct 02 04:54:53 lightdm[2344]: ModuleNotFoundError: No module named 'camilladsp'
oct 02 04:54:53 audit[2337]: AUDIT1103 pid=2337 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_env,pam_permit acct="lightdm" exe="/usr/bin/lightdm" hostname=? addr=? terminal=:0 res=success'
oct 02 04:54:53 lightdm[2337]: pam_unix(lightdm-greeter:session): session opened for user lightdm(uid=975) by (uid=0)
oct 02 04:54:53 systemd-logind[1432]: New session 'c1' of user 'lightdm' with class 'greeter' and type 'x11'.
oct 02 04:54:53 systemd[1]: Created slice user-975.slice - User Slice of UID 975.
oct 02 04:54:53 systemd[1]: Starting user-runtime-dir@975.service - User Runtime Directory /run/user/975...
oct 02 04:54:53 systemd[2270]: Reached target sound.target - Sound Card.
oct 02 04:54:53 systemd[1]: Finished user-runtime-dir@975.service - User Runtime Directory /run/user/975.
oct 02 04:54:53 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user-runtime-dir@975 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
oct 02 04:54:53 systemd[1]: Starting user@975.service - User Manager for UID 975...
oct 02 04:54:53 audit[2372]: AUDIT1101 pid=2372 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_unix acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=success'
oct 02 04:54:53 audit[2372]: AUDIT1103 pid=2372 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=? acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=failed'
oct 02 04:54:53 systemd-logind[1432]: New session '2' of user 'lightdm' with class 'manager-early' and type 'unspecified'.
oct 02 04:54:53 (systemd)[2372]: pam_unix(systemd-user:session): session opened for user lightdm(uid=975) by lightdm(uid=0)
oct 02 04:54:53 audit[2372]: AUDIT1105 pid=2372 uid=0 auid=975 ses=2 msg='op=PAM:session_open grantors=pam_selinux,pam_selinux,pam_loginuid,pam_keyinit,pam_namespace,pam_systemd_home,pam_umask,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="lightdm" exe="/usr/lib/systemd/systemd-executor" hostname=? addr=? terminal=? res=success'
oct 02 04:54:53 abrt-server[2345]: Executable '/home/shizuma/bin/CDSPremote.py' doesn't belong to any package and ProcessUnpackaged is set to 'no'
oct 02 04:54:53 abrt-server[2345]: 'post-create' on '/var/spool/abrt/Python3-2026-10-02-04:54:53-2344' exited with 1
oct 02 04:54:53 abrt-server[2345]: Deleting problem directory '/var/spool/abrt/Python3-2026-10-02-04:54:53-2344'

The home directory is the home for the lightdm user as found in /etc/passwd

lightdm:x:984:982::/var/lib/lightdm:/sbin/nologin

That means that ~ expands to /var/lib/lightdm.

Remember: you are not logged in yet when the greeter is running so referring to anything you your home directory should be by the full path name or avoided.

You should probably separate what you want to run to setup your greeter and what you want to run when you start your user session.

edit:
Since the python libraries needed for your script are installed for your user that will need to move.

There are a bunch of different ways to do this depending on what and how you’d prefer to do this.
You can do a .desktop flie in ~/.config/autostart
You could add it to one of the shell or x startup files for the user.

Right.

I moved it to .config/autostart and it worked exactly once. On subsequent boots, no display. .xsession-errors:

Cjs-Message: 06:58:53.273: JS LOG: [LookingGlass/info] Loaded applet calendar@cinnamon.org in 39 ms
Cjs-Message: 06:58:53.282: JS LOG: [LookingGlass/info] Loaded applet keyboard@cinnamon.org in 9 ms
SELinux Troubleshooter : Applet requiert que SELinux soit activé
Cjs-Message: 06:58:53.294: JS LOG: [LookingGlass/info] Loaded applet notifications@cinnamon.org in 12 ms
Cjs-Message: 06:58:53.364: JS LOG: [LookingGlass/info] Loaded applet xrandr@cinnamon.org in 70 ms
Traceback (most recent call last):
  File "/home/shizuma/bin/CDSPremote.py", line 12, in <module>
    cdsp.connect()
    ~~~~~~~~~~~~^^
  File "/home/shizuma/.local/lib/python3.14/site-packages/camilladsp/camillaws.py", line 101, in connect
    self._ws = create_connection(f"ws://{self._host}:{self._port}")
               ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_core.py", line 664, in create_connection
    websock.connect(url, **options)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_core.py", line 263, in connect
    self.sock, addrs = connect(
                       ~~~~~~~^
        url, self.sock_opt, proxy_info(**options), options.pop("socket", None)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 146, in connect
    sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
  File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 233, in _open_socket
    raise err
  File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 210, in _open_socket
    sock.connect(address)
    ~~~~~~~~~~~~^^^^^^^^^
ConnectionRefusedError: [Errno 111] Connection refused
(...)
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x3000004
Cjs-Message: 06:59:24.681: JS LOG: [LookingGlass/info] GPU offload supported: false

(cinnamon:3089): Cjs-CRITICAL **: 06:59:28.806: Object St.Button (0x55e0433b5230), has been already disposed — impossible to get any property from it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x55e0424dbe70 ==
#0   55e0427390d8 i   /usr/share/cinnamon/js/ui/messageTray.js:1044 (8ee5678d0 @ 566)
conky: received SIGHUP, SIGINT, or SIGTERM to terminate. bye!
cinnamon-session-binary[2621]: WARNING: t+160.55746s: Application 'cinnamon-settings-daemon-media-keys.desktop' killed by signal 1
cinnamon-session-binary[2621]: WARNING: t+160.55771s: Application 'cinnamon-settings-daemon-power.desktop' killed by signal 1
cinnamon-session-binary[2621]: WARNING: t+160.55780s: Application 'cinnamon-settings-daemon-print-notifications.desktop' killed by signal 1
cinnamon-session-binary[2621]: WARNING: t+160.55791s: Application 'cinnamon-settings-daemon-wacom.desktop' killed by signal 1
cinnamon-session-binary[2621]: WARNING: t+160.55812s: Application 'cinnamon.desktop' killed by signal 15
cinnamon-session-binary[2621]: WARNING: t+160.56106s: Application 'xapp-sn-watcher.desktop' killed by signal 15
[2026-10-02 07:01:31.847][error] Child process of type Utility exited with exit code 15 due to killed
[3205:1002/070131.848092:ERROR:content/browser/network_service_instance_impl.cc:703] Network service crashed or was terminated, restarting service.
cinnamon-session-binary[2621]: WARNING: t+160.56624s: Application 'cinnamon-settings-daemon-xsettings.desktop' killed by signal 1
[3205:1002/070131.861098:ERROR:ui/base/x/x11_display_util.cc:326] XRandR returned no displays; falling back to root window
[3205:1002/070131.861329:FATAL:electron/shell/browser/electron_browser_main_parts.cc:535] Failed to shutdown.
cinnamon-session-binary[2621]: GLib-CRITICAL: t+160.61477s: g_variant_unref: assertion 'value != NULL' failed
cinnamon-session-binary[2621]: CRITICAL: t+160.61481s: Unable to close Cinnamon's end session dialog: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected

(xapp-sn-watcher:23527): Gtk-WARNING **: 07:01:31.975: cannot open display: :0
/usr/bin/cinnamon-launcher:67: DeprecationWarning: This process (pid=23518) is multi-threaded, use of fork() may lead to deadlocks in the child.
  self.cinnamon_pid = os.fork()

(cinnamon:23630): muffin-WARNING **: 07:01:32.038: Failed to create backend: Unable to open display ':0'

Looks like this script should not be run until the desktop is fully displayed and stable. I have no idea how to implement it though. So I run the script manually. It has been mapped to Super-F3.

You could try putting a delay it starting by modifying the Exec line:
Exec=/usr/bin/bash -c "sleep 5 && script"

You may want to consider separating the display setup and the python script.

Thanks for your reply. The delay seems unreliable. Cinnamon is very slow to stabilize compared to xfce. I kept your idea to separate xrandr from the python script in lightdm setup so

$ cat /usr/local/sbin/monitor-init.sh 
#!/bin/sh
xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal --output DisplayPort-1 --off --output HDMI-A-0 --off
#bash /home/shizuma/bin/pc.sh
/usr/bin/numlockx on

and created and enabled a service for the display when the desktop is stable:

$ systemctl --user cat mydisplay.service
# /home/shizuma/.config/systemd/user/mydisplay.service
[Unit]
Description=Lancement de xrandr et CDSPremote après le bureau et le réseau
After=graphical-session.target network-online.target
Wants=graphical-session.target network-online.target

[Service]
Type=simple
ExecStartPre=/usr/bin/sleep 2
ExecStart=/usr/bin/bash /home/shizuma/bin/pc.sh

[Install]
WantedBy=graphical-session.target

Seems to do exactly what is expected with the exception that after the greeter screen, the display is black. Only the mouse cursor. The desktop is visible only when or just before/after the service is executed.

Hmmm not quite yet, still starting to early:

oct 02 11:06:40 shizuma systemd[2207]: Started mydisplay.service - Lancement de xrandr et CDSPremote après le bureau et le réseau.
oct 02 11:06:41 shizuma python[5362]: detected unhandled Python exception in '/home/shizuma/bin/CDSPremote.py'
oct 02 11:06:41 shizuma bash[5362]: Traceback (most recent call last):
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/bin/CDSPremote.py", line 12, in <module>
oct 02 11:06:41 shizuma bash[5362]:     cdsp.connect()
oct 02 11:06:41 shizuma bash[5362]:     ~~~~~~~~~~~~^^
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/camilladsp/camillaws.py", line 101, in connect
oct 02 11:06:41 shizuma bash[5362]:     self._ws = create_connection(f"ws://{self._host}:{self._port}")
oct 02 11:06:41 shizuma bash[5362]:                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_core.py", line 664, in create_connection
oct 02 11:06:41 shizuma bash[5362]:     websock.connect(url, **options)
oct 02 11:06:41 shizuma bash[5362]:     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_core.py", line 263, in connect
oct 02 11:06:41 shizuma bash[5362]:     self.sock, addrs = connect(
oct 02 11:06:41 shizuma bash[5362]:                        ~~~~~~~^
oct 02 11:06:41 shizuma bash[5362]:         url, self.sock_opt, proxy_info(**options), options.pop("socket", None)
oct 02 11:06:41 shizuma bash[5362]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
oct 02 11:06:41 shizuma bash[5362]:     )
oct 02 11:06:41 shizuma bash[5362]:     ^
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 146, in connect
oct 02 11:06:41 shizuma bash[5362]:     sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 233, in _open_socket
oct 02 11:06:41 shizuma bash[5362]:     raise err
oct 02 11:06:41 shizuma bash[5362]:   File "/home/shizuma/.local/lib/python3.14/site-packages/websocket/_http.py", line 210, in _open_socket
oct 02 11:06:41 shizuma bash[5362]:     sock.connect(address)
oct 02 11:06:41 shizuma bash[5362]:     ~~~~~~~~~~~~^^^^^^^^^
oct 02 11:06:41 shizuma bash[5362]: ConnectionRefusedError: [Errno 111] Connection refused
oct 02 11:06:41 shizuma systemd[2207]: mydisplay.service: Main process exited, code=exited, status=1/FAILURE
oct 02 11:06:41 shizuma systemd[2207]: mydisplay.service: Failed with result 'exit-code'.
oct 02 11:06:41 shizuma abrt-server[5405]: Executable '/home/shizuma/bin/CDSPremote.py' doesn't belong to any package and ProcessUnpackaged is set to 'no'

Eliminated the service and added line to execute ~bin/pc.sh to the file that setup the sound system which is executed as an autostart. No more error. No more permission issue. No lightdm complaining. Done. An awkward one.

./.config/autostart/fixsound.desktop:Exec=/home/shizuma/bin/fixsound.sh
$ cat bin/fixsound.sh|grep -v '#'
sleep 2
amixer -c Loopback set PCM 100% unmute &>/dev/null
amixer -c Generic_1 sset PCM 100% unmute &>/dev/null
amixer -c Generic_1 sset Master 100% unmute &>/dev/null
amixer -c Generic_1 sset Front 100% unmute &>/dev/null
amixer -c Generic_1 sset Surround 100% unmute &>/dev/null
amixer -c Generic_1 sset Center 100% unmute &>/dev/null
amixer -c Generic_1 sset LFE 100% unmute &>/dev/null
amixer -c Generic_1 sset Beep 100% unmute &>/dev/null
amixer -c Generic_1 sset 'Channel Mode' 6ch &>/dev/null
amixer -c Generic_1 sset 'Auto-Mute Mode' Disabled &>/dev/null
systemctl --user restart camilladsp camillagui &>/dev/null || true

sleep 5
bash ~/bin/pc.sh

That was quite an adventure. For historical purpose, my prior setup when I added the HDMI monitor as 3rd display: With latest kernel, primary monitor auto resets to DPMI0. Should be DP0 - I hate HDMI!

Many thanks to @chillzone , @vekruse and @grumpey for their kind collaboration!

I would suggest to set the resolution using an xorg.d snippet, for example like this
cat /etc/X11/xorg.conf.d/50-mode-1280x720.conf

# Set default screen resolution.

Section "Screen"
    Identifier    "Default Screen"
    SubSection    "Display"
        Modes    "1280x720"
    EndSubSection
EndSection

This, of course, doesn’t work in Wayland, where you have to set the resolution in the desktop environment settings.

I don’t know. the main display DP-0 has the proper resolution already detected:

$ cat .local/share/xorg/Xorg.0.log|grep "initial mode"
[    36.811] (II) AMDGPU(0): Using spanning desktop for initial modes
[    36.811] (II) AMDGPU(0): Output DisplayPort-0 using initial mode 1920x1080 +0+0
[    36.811] (II) AMDGPU(0): Output HDMI-A-0 using initial mode 1920x1080 +1920+0
[    36.811] (II) AMDGPU(0): Output DisplayPort-1 using initial mode 1024x768 +3840+0

The resolutions for the other display are like that, handled by xrandr:

HDMI-A-0  1728x972_60.00 +1920+60
DisplayPort-1 1920x1080  +0x0

and I have already some config:

$ cat /etc/X11/xorg.conf.d/*
Section "Device"
    Identifier "AMDGPU"
    Driver "amdgpu"
    Option "Monitor-DisplayPort-0" "PrimaryMonitor"
EndSection

Section "Monitor"
    Identifier "PrimaryMonitor"
    Option "Primary" "true"
EndSection
Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
    Option "EnablePageFlip" "off"
    Option "TearFree" "false"
EndSection