Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#49953 - [lightdm] .xprofile and .Xresources have no effect upon window manager restart

Attached to Project: Arch Linux
Opened by Silvio B (smb1234) - Tuesday, 05 July 2016, 08:05 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 05 July 2016, 13:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Maxime Gauduin (Alucryd)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No


I have noticed that with the latest package version, .xprofile and .Xresources do not get parsed / executed when restarting the window manager and logging in again.

I believe there is a regression from 1.18.2-1 -> 1.18.2-2, not sure whether related to Arch or upstream, as the Xsession script seems created by Arch.

I am using awesome window manager with its default session along with some .Xresources and an .xprofile, and have lightdm enabled as a systemd service. The expected behavior is that /etc/lightdm/Xsession evaluates both files when logging in through lightdm.

Steps to reproduce:

A minimal config to reproduce is and .xprofile with (for example)

xset -b # turn off the terminal bell

and a .Xresources with some entries, just to check whether they get parsed by xrdb.

When I start my machine an first log on to the awesome session with the setup above, the .Xresources get correctly parsed by /etc/lightdm/Xsession (verify by seeing entries with "xrdb -query"), and the terminal bell is off (verify by hitting backspace in an empty urxvt or xterm).

When I terminate my window manager, return to lightdm and login again, the xrdb database is empty (verify by "xrdb -query" and the terminal bell is on. Somehow it seems that either /etc/lightdm/Xsession is not executed the second time, or that it is executed but the commands have no effect on the X instance.

In 1.18.2-1 this used to work just fine. I hope this is helpful to determine whether it is an Arch issue or upstream, let me know if you need more information.
This task depends upon

Comment by Silvio B (smb1234) - Tuesday, 05 July 2016, 08:13 GMT
Got the number of the previous version wrong: this worked in 1.18.1-2
Comment by Maxime Gauduin (Alucryd) - Tuesday, 05 July 2016, 17:01 GMT
There were no arch-related changes between 1.18.1-2 and 1.18.2-2, only between 1.18.1-1 and 1.18.1-2, so it looks like something changed upstream.

The bugs targeted by 1.18.2:
Among those, seems the more likely culprit. Could you take this upstream and report back here?
Comment by Andreas Radke (AndyRTR) - Thursday, 14 July 2016, 07:04 GMT
While trying to get freetype2 configured the way I like it I've run into trouble with lightdm not properly reading the
pam configuration in /etc/environment or some /etc/profile.d/ file. The variable declared in /etc/environment is
shown in "env" but has no effect to freetype or apps that depend on that setting. Anything in profile.d isn't exported at all here.
I'm using lightdm with lightdm-gtk-greeter and use mksh for login and interactive shell. Changing to bash makes no difference here.

There seem to be 2 issues. One is the not used pam configuration and one seems the not properly parsed Xsession. Maybe both have the same culprint.

Is there any reason why we are still shipping our own lightdm Xsession file? SuSE depends on Xdm and its xsession file.
In Fedora lightdm depends on xinit shipping a Xsession file (we don't do this anymore). For Ubuntu I can't find it to ship any xsession file at all.

All other major distros place the lightdm config into either /etc/lightdm/lighdtm.conf.d/xx-foo.conf or into /usr/share/lightdm/lightdm.conf.d/xx-foo.conf.
Maybe this would solve some timing related config reading issues.

Comment by Maxime Gauduin (Alucryd) - Thursday, 14 July 2016, 08:18 GMT
Using lightdm-gtk-greeter and zsh as login shell, everything in profile.d is correctly exported, and xrdb is populated every time I log out and back in.

Andreas, which setting are you trying to export? Maybe it needs to be added to xrdb?

As for pam, lightdm uses /etc/pam.d/system-login which requires so there shouldn't be any problem on that side.
Comment by Andreas Radke (AndyRTR) - Thursday, 14 July 2016, 14:12 GMT
I'm trying to use freetype2 with new v40 renderer using FT2_SUBPIXEL_HINTING=2 variable.

andyrtr@laptop64:/home/andyrtr $ cat /etc/environment
# This file is parsed by pam_env module
# Syntax: simple "KEY=VAL" pairs on separate lines

#FT2_SUBPIXEL_HINTING=0 # Classic mode
#FT2_SUBPIXEL_HINTING=1 # Infinality mode
FT2_SUBPIXEL_HINTING=2 # Default mode

andyrtr@laptop64:/home/andyrtr $ env | grep FT2_SUBPIXEL_HINTING

but "ftview -r 96 6 /usr/share/fonts/TTF/arial.ttf" reports back v35 is used. And other autoloaded apps (Chromium, Claws, Pidgin, HexChat,...) show old font rendering until I restart them.

When using root@laptop64:/root # cat /etc/profile.d/
#export FT2_SUBPIXEL_HINTING=0 # Classic mode
#export FT2_SUBPIXEL_HINTING=1 # Infinality mode
export FT2_SUBPIXEL_HINTING=2 # Default mode

FT2_SUBPIXEL_HINTING=2 is not exported at all here and won't show up in "env".

/home/andyrtr/.Xresources only contains urxvt related settings./home/andyrtr/.xinitrc is empty and no ~/.Xsession.
Comment by Alif (alive4ever) - Monday, 18 July 2016, 04:43 GMT
One of possible solution is creating symlink ~/.Xdefaults pointing to ~/.Xresources

That should solve this issue
Comment by Vladimir (_v_l) - Thursday, 21 July 2016, 09:30 GMT
I faced with the same problem while using openbox and awesome. I tried to debug what is going on but stuck.

0. To see what is going on I made some changes to /etc/lightdm/Xsession (show only changed part)

echo "Running X session wrapper"
echo "...DEBUG... running wrapper" >> /tmp/xsession-wrapper.log

# Load profile
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
if [ -f "$file" ]; then
echo "Loading profile from $file";
. "$file"

# Load resources
echo "...DEBUG... before loading RESOURCES" >> /tmp/xsession-wrapper.log
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
if [ -f "$file" ]; then
echo "Loading resource: $file"
echo "...DEBUG... before loading '$file':" >> /tmp/xsession-wrapper.log
echo "...DEBUG... `xrdb -query`" >> /tmp/xsession-wrapper.log
echo "...DEBUG... loading '$file'" >> /tmp/xsession-wrapper.log
xrdb -merge "$file"
echo "...DEBUG... loaded? $?" >> /tmp/xsession-wrapper.log
echo "...DEBUG... after load of '$file':" >> /tmp/xsession-wrapper.log
echo "...DEBUG... `xrdb -query`" >> /tmp/xsession-wrapper.log

1. There must be clean start of lightdm, for example, after reboot or just simply restart the service
2. log in (I used awesome)
3. start terminal (I used urxvt) and run
xrdb -query > tmp/xrdb-query-3.log
4. log out
5. log in again without restart lightdm service
6. run xrdb again
xrdb -query > tmp/xrdb-query-6.log
7. look into xsession-wrapper.log.

I will report the problem to the upstream.