Lightdm screws up environmental variables for any user logged in through it. It cuts down $PATH for user to /usr/local/bin:/usr/bin:/bin, cutting away such paths as /sbin:/usr/sbin:/usr/local/sbin:/home/user/bin. It even screws up envvars set by /etc/login.conf! As a consequence - it screws up localization configured via /etc/login.conf This can not be justified by "sbin's are for superusers", because they are not. FreeBSD: 11.0-RELEASE-p8 lightdm: 1.20.0_4, compiled from ports using synth (because it fails to compile using portmaster).
The build with portmaster is fixed with https://svnweb.freebsd.org/ports/head/x11/lightdm/Makefile?r1=437590&r2=437589&pathrev=437590
It does not appear to be a FreeBSD specific issue that LightDM does not set environment variable as per a normal shell login. Debian Linux: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752129 CrunchBang Linux: http://crunchbang.org/forums/viewtopic.php?id=39437 Gentoo Linux: https://forums.gentoo.org/viewtopic-t-892052-start-0.html According to this post on the lightdm mailing list, the normal environment variables are supposed to be brought in via the pam_env module, which does not exist on FreeBSD and is therefore commented out by patches in the FreeBSD port. https://lists.freedesktop.org/archives/lightdm/2016-February/000934.html As an alternative, you can apparently use $HOME/.xsessionrc, but I would prefer that it automatically brought in environment variables to normal FreeBSD way.
(In reply to Ben Woods from comment #2) Oh, so it's just a DM of poo quality, got it. Feel free to do whatever with this issue.