OmegaPhil
2016-Feb-04 20:37 UTC
[LightDM] Setting environment variables the correct way for lightdm/XFCE4
I currently need to set LD_PRELOAD systemwide in order to work around an aufs kernel memory allocation problem - '/etc/environment' LD_PRELOAD is obeyed by shells launched outside a GUI, however anything launched through lightdm doesn't get this. I can add the export to '~/.bashrc', however I need it also present for any GUI program launched from the X session. Fiddling with '/etc/profile.d/' scripts and adding it to lightdm's init.d script didn't work, looking through lightdm's source (e.g. seat.c) suggests it gets stripped unless LIGHTDM_TEST_ROOT is set, however setting this in '/etc/environment' or in the init.d script still doesn't cause LD_PRELOAD to be honoured. The only thing that 'works' is adding the exports to '/etc/xdg/xfce4/xinitrc', just above the '# run xfce4-session if installed' block. Is there a recommended way (other than this) for a sysadmin to set LD_PRELOAD that is respected by lightdm/XFCE4/etc? Thanks for any help -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <http://lists.freedesktop.org/archives/lightdm/attachments/20160204/d9c60b24/attachment.sig>
Robert Ancell
2016-Feb-04 21:29 UTC
[LightDM] Setting environment variables the correct way for lightdm/XFCE4
What OS are you using? The pam_env module should bring all the variables from /etc/environment into a user session. See /etc/pam.d/lightdm to check if it is configured like that. On Fri, 5 Feb 2016 at 09:44 OmegaPhil <OmegaPhil at startmail.com> wrote:> I currently need to set LD_PRELOAD systemwide in order to work around an > aufs kernel memory allocation problem - '/etc/environment' LD_PRELOAD is > obeyed by shells launched outside a GUI, however anything launched > through lightdm doesn't get this. I can add the export to '~/.bashrc', > however I need it also present for any GUI program launched from the X > session. > > Fiddling with '/etc/profile.d/' scripts and adding it to lightdm's > init.d script didn't work, looking through lightdm's source (e.g. > seat.c) suggests it gets stripped unless LIGHTDM_TEST_ROOT is set, > however setting this in '/etc/environment' or in the init.d script still > doesn't cause LD_PRELOAD to be honoured. > > The only thing that 'works' is adding the exports to > '/etc/xdg/xfce4/xinitrc', just above the '# run xfce4-session if > installed' block. > > Is there a recommended way (other than this) for a sysadmin to set > LD_PRELOAD that is respected by lightdm/XFCE4/etc? > > Thanks for any help > > _______________________________________________ > LightDM mailing list > LightDM at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/lightdm >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/lightdm/attachments/20160204/4ddfd4b9/attachment.html>