LMDE 3 - fix *profile(s)
auf dieser Seite:
Feedback:
Seite übersetzen:
Seite validieren:

last modified 2019-04-09

How to fix LMDE 3 (cindy) not sourcing *profiles on x-session startup (using the default lightdm display manager).
Use at your own risk - you have to read and accept the disclaimer
Experienced users - not needing any extra info and being aware of implied risks - could skip the detailed description and just use the essential summary at the end:
Long story short

Motivation

With the current default setup of LMDE 3 (cindy) profiles are not read on x-session startup. The issue is related to the usage of lightdm as new default DM for LMDE 3, which does miss some required "bits" to be fully setup.
Affected files are:
  • /etc/profile
  • /etc/xprofile
  • $HOME/.profile
  • $HOME/.xprofile
This workaround is only needed as long the suggested fix (or another solution) is not deployed by regular updates of LMDE 3 (cindy). Users of the previous LMDE 2 (betsy) version are not affected (at least not by the underlying issue).

Objective

The workaround is meant to be used for installations, which are using the default DM lightdm. If you are using a different DM, the fix will not work out of the box (but might help to sort out identical issues with other DMs too).
The fix does add two missing files to a LMDE 3 installation and set a required option at the configuration of lightdm (lightdm.conf).

Remarks

Before applying any modifications at all, you should first check if you are (still) affected at all, or if there is a related update available already.
Although the fix should not break an actual installation and is tested keeping safety-first in mind: Backup important data BEFORE modifying your system by applying the fix (at least if your data is of any value to you).

Operational Steps

1 - Test if being affected

There are several ways one could check if profiles get read/sourced on startup.

1.1 - append echo-output to file at /tmp

Add (temporarily) following lines to the header of each profile-file of interest:

# debugging x-profiles getting (not) sourced on x-session startup
# comment or remove if not needed anymore (after debugging)
date >>/tmp/pro-$USER.txt
echo "PPID='$PPID' '$0' src '$BASH_SOURCE' for '$USER'" >>/tmp/pro-$USER.txt

Remarks: using /tmp/pro-$USER.txt does ensure the file(s) will be writable by the actual user(s) + having them at a single location. Adding (optional) the output of date does help to keep track of repeated calls from different consecutive tests using logout & login, or by switching to a login-shell. Due to be located at /tmp, the files will be removed on shutdown/reboot.
  • $PPID - the process ID of the calling process
  • $0 - the caller = the DM (lightdm) or a login-shell (bash)
  • $BASH_SOURCE - the name of the actual profile-file
  • $USER - account-name of the current user
If the according profile-file is read/sourced, /tmp/pro-*.txt -files will be available after logout/login and contain the according message. If this is the case, then you are NOT affected and could just remove/comment the according echo-statement(s) and stop right here.
For a working setup an according output will look similar to the following:
demo@lmde-3-cinnamon-64bit:~$ ls /tmp/pro*
/tmp/pro-demo.txt
demo@lmde-3-cinnamon-64bit:~$ cat /tmp/pro-demo.txt 
Tue Apr  9 01:01:19 CEST 2019
PPID='746' '/usr/sbin/lightdm-session' src '/etc/profile' for 'demo'
Tue Apr  9 01:01:19 CEST 2019
PPID='746' '/usr/sbin/lightdm-session' src '/home/demo/.profile' for 'demo'
Tue Apr  9 01:01:19 CEST 2019
PPID='746' '/usr/sbin/lightdm-session' src '/etc/xprofile' for 'demo'
Tue Apr  9 01:01:19 CEST 2019
PPID='746' '/usr/sbin/lightdm-session' src '/home/demo/.xprofile' for 'demo'
Tue Apr  9 01:34:30 CEST 2019
PPID='1863' '-bash' src '/etc/profile' for 'demo'
Tue Apr  9 01:34:30 CEST 2019
PPID='1863' '-bash' src '/home/demo/.profile' for 'demo'
demo@lmde-3-cinnamon-64bit:~$ 
Showing that the user has logged into the x-session and afterwards using a bash login-shell using a working setup => no need to apply the fix at all.
If /tmp/pro-*.txt -files do not get created (if only using the x-session), or would only contain according entries created by using a bash login-shell: your are affected.

1.2 - export and check for unique env-variable

Alternative: You can check if exported unique environment-variables will be available on the x-session by inspecting the output of env. Be sure to have some unique variable name in use, which does not get set anywhere else.
To cross-check that missing environment variables are exported in a proper way, one could switch to a console using CTRL+ALT+F1 (switch back to the gui later using ALT+F7) and login there. As the bash shell does source /etc/profile and ~/.profile via (an unmodified/default) ~/.bashrc if being used as login-shell, defined env-variables should be available at the console-session (/etc/xprofile and ~/.xprofile are not honored/sourced by a bash login-shell).
If extra/modified env-variables are visible only, using a bash login-shell: you are affected.

2 - Check for missing updates

If you did proof being affected, check next for offered updates related to lightdm (in case the fix got merged/accepted by mint devs in the meantime) and install available updates instead of using this fix.
Any related update/fix will require you to reboot to get into effect. Recheck afterwards again: If your issue is solved - remove/comment any extra edits on your profile-files.

3 - Install the fix

You will need to be member of sudo -group to be able to apply the required modifications. This will typically be the case for the primary user, who did install the machine. To check current user ids and groups use:

id

which will output a similar output (and should list sudo):
demo@lmde-3-cinnamon-64bit:~$ id
uid=1000(demo) gid=1000(demo) groups=1000(demo),27(sudo)
demo@lmde-3-cinnamon-64bit:~$ 
You should first check for last recent information supported by the tool itself. This will just display according technical information and wont start any action at all.
Copy/Paste the entire command, including the leading 'source' and the trailing 'VERINFO' at the end:

source <(wget \
https://www.orcus.de/Entities/linux/lmde3-fix-profile.sh \
-O - 2>/dev/null) VERINFO

Which will show an output similar/identical to:
demo@lmde-3-cinnamon-64bit:~$ source <(wget \
https://www.orcus.de/Entities/linux/lmde3-fix-profile.sh \
-O - 2>/dev/null) VERINFO

 general information
 lmde3-fix-profile.sh V002a - 2019-04-09
 ----------------------------------------------------------------------
 LMDE 3 (cindy) did switch the default DM from mdm to lightdm.
 With LMDE 2 (betsy) mdm did care about sourcing "*profiles".
 With LMDE 3 (cindy) lightdm is missing an according functionality with
 the default installation.
 ----------------------------------------------------------------------
 Thus defined export env-variables will not be usable with this files:

	/etc/profile
	/etc/xprofile
	/home/oadm/.profile		(aka $HOME/.profile)
	/home/oadm/.xprofile		(aka $HOME/.xprofile)

 Accordingly it is not possible to setup (install- or) user-specific
 environment variables in a common/expected way for the x-session.
 ----------------------------------------------------------------------
 This workaround does
 - add missing/required files (lightdm-wrapper and a helper-file for
   error-/message-display)
 - adjust lightdm config to override a precompiled lightdm setting
   to honor/use the lightdm-wrapper.
 ----------------------------------------------------------------------
 Remark: lightdm does use precompiled config-values, where defaults
 differ between the debian- and ubuntu-based versions regarding usage
 of lightdm-wrapper!
	ubuntu/mint 19.x -version = active
	debian/LMDE3     -version = inactive

 Thus an according config-option has to be set explicitly with LMDE3,
 to activate the usage of an available lightdm-wrapper.
 ----------------------------------------------------------------------
 Before doing any modifications to the installation, the tool does test
 if 
  - you are using a matching version of LMDE 3
  - lightdm is used (a lightdm-session is running) at all
  - there are no other/previous versions of the required additional
    files present
  - the lightdm-wrapper setting is not configured

 If any of this tests wont match, the system will NOT get modified.
 ======================================================================
 modifications done in detail
 add wrapper-file : /usr/sbin/lightdm-session
 create helper-dir: /usr/lib/lightdm
 add helper-file  : /usr/lib/lightdm/config-error-dialog.sh
 adjust DM config : /etc/lightdm/lightdm.conf
 - replace        : #session-wrapper=lightdm-session
 - with           : session-wrapper=lightdm-session
 ----------------------------------------------------------------------
 As long the debian-version of lightm  does use a disabled precompiled
 value of 'session-wrapper" it is sufficient to comment the according
 line in the lightdm.conf file and reboot afterwards to disable the
 wrapper again.
 ----------------------------------------------------------------------
 Besides sourcing the *profiles, the wrapper (based on the according
 version used at mint 19.0) does source further directories - see
 the wrapper-file for more information.
demo@lmde-3-cinnamon-64bit:~$ 

Applying the actual fix is quiet simple - by using the command without the VERINFO parameter:

source <(wget \
https://www.orcus.de/Entities/linux/lmde3-fix-profile.sh \
-O - 2>/dev/null)

The tool will in any case first check if your are using a matching and unmodified (in regards to lightdm-setup) installation. And will only in this case offer to apply the fix at all.

[click to enlarge]
If you decide to abort the fix using "CTRL+C": Nothing has been modified or downloaded by the tool until now at all. Only thing left to do is: Remove/comment potential made debugging-modifications added to the *profile-files.
After using "Enter" to continue, you will get asked for YOUR password to perform the actual modifications. After successfully entering your pw, the tool downloads required files and adjust the setting of lightdm.conf to make use of it.

[click to enlarge]
As part of the installation there will be a file lmde3-fix-profile.txt created showing information about the used version of the fix, and some general information. Which you could inspect at a later time using:

cat lmde3-fix-profile.txt

which should return something similar to:
demo@lmde-3-cinnamon-64bit:~$ cat lmde3-fix-profile.txt 
lmde3-fix-profile.sh
V002 - 2019-04-04
Add missing *profile support to LMDE 3 with lightdm
applied at:
Tue Apr  9 02:09:24 CEST 2019
finished without reported errors at:
Tue Apr  9 02:09:43 CEST 2019
demo@lmde-3-cinnamon-64bit:~$ 
To get the modifications into effect a reboot of your machine is required.
You should check afterwards, that your profiles are getting sourced now by the x-session as expected. If everything is looking fine, you should remove/comment debug-changes made at your *profile -files.

4 - Further questions

If you have further questions - I often hang around as "orcus" at the #linuxmint-help support-channel at spotchat-irc.
Good luck - have fun

Long story short

If you did use already the above detailed description: just ignore this summary! This is a short summary for the experienced user, needing only the essential bits.
You will need sudo-rights to be able to execute the installer. The fix does require (and test for) to be used with an unmodified installation of LMDE 3.
To install the fix run:

source <(wget \
https://www.orcus.de/Entities/linux/lmde3-fix-profile.sh \
-O - )

After applying the fix you need to reboot, to get the modifications into effect.

webcam

refresh-rate: 10 sec.

translate

quality matters

valid HTML 4.01 Transitional
valid CSS level 3
//HOME / Workarounds
© 1998-2019 by ORCUS GmbH - created with ORCUS® XmlSite-generator OxsSite 006.02 mono linux at:2019-05-06T04:05:21+01:00