is it problematic to disable 'session optional pam_systemd.so' in etc/pam.d/common-session/ to execute one line to speed up boot time?
0
votes
0
answers
109
views
At boot im running following command:
su vis -c 'QT_QPA_PLATFORM=offscreen /usr/bin/browser --version'
/usr/bin/browser
being a custom browser, which cannot be run as root. The script that is executing this command however is run as root, meaning to prevent /usr/bin/browser
from being run as root I have to use su
to switch to another user. This is a debian embedded system and because of the su
this command is taking a long time(2+ min). I have seen that as a workaround you can disable session optional pam_systemd.so
inside /etc/pam.d/common-session
.
Workaround mentioned here:
https://serverfault.com/questions/1050717/why-su-command-takes-to-long-in-nested-debian-lxd-containers
So i figured i can just disable it execute the command and then enable it again, like so:
sudo sed -i '/^session\s\+optional\s\+pam_systemd\.so/s/^/# /' /etc/pam.d/common-session
su vis -c 'QT_QPA_PLATFORM=offscreen /usr/bin/browser --version'
sudo sed -i '/^#\s\+session\s\+optional\s\+pam_systemd\.so/s/^#\s\+//' /etc/pam.d/common-session
the first sed adds a # to session optional pam_systemd.so
and the second sed removes it again.
This does indeed work, no more 2+ min waiting on each boot, but im just wondering if this causes any potential issues that im unaware of. The system is debian bullseye on armhf.
Asked by sir
(1 rep)
Sep 12, 2024, 09:49 AM
Last activity: Sep 12, 2024, 10:21 AM
Last activity: Sep 12, 2024, 10:21 AM