<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div>I did what you asked, logged out and logged back in. No change. Still I get<br>
<br>
module: command not found<br>
<br>
when I fire up a terminal session. There is an interesting observation, though.<br>
<br>
<br>
These are the details:<br>
<br>
<br>
1 I removed the symlink I had in /etc/profile.d/ pointing to the initialisation<br>
script in the modules software compiled from Sourceforge tarball which I<br>
put under /opt<br>
<br>
<br>
2 I installed the distro package:<br>
<br>
sudo apt install environment-modules<br>
<br>
<br>
3 I commented out the line<br>
<br>
<br>
BASH_VERSION= . "$CONFIG_FILE" 2>"$ERR"<br>
<br>
<br>
and put in</div>
<br>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<div>. "$CONFIG_FILE" 2>"$ERR"<br>
<br>
<br>
in /usr/sbin/lightdm-session just below the line I commented out.<br>
<br>
<br>
4 Logged out and logged back in. Incidentally this required a restart of<br>
X using Ctrl+Alt+Backspace. On logging back in I got an error window saying:<br>
<br>
<br>
Error found when loading /home/gostal/.profile<br>
<br>
...module: command not found<br>
<br>
</div>
<div>...<br>
<br>
<br>
This is because I now have put the line:<br>
<br>
<br>
module load use.own<br>
<br>
<br>
in ~/.profile to make my own modules available. This is only half the<br>
reason. I had also forgot to rename the package initialisation script<br>
under /etc/profile.d/ which I had saved as modules.sh.ubuntu before<br>
editing it to see if it was run some time ago. For some reason renaming<br>
is not enough as reinstalling the package then does not put modules.sh under<br>
<div>/etc/profile.d/. Perhaps it only goes by a contents hash, what do I know?<br>
<br>
<br>
5 Renamed the saved<br>
<br>
<br>
/etc/profile.d/modules.sh.ubuntu<br>
<br>
<br>
to<br>
<br>
<br>
/etc/profile.d/modules.sh<br>
<br>
</div>
<div>Logged out and logged back in. This time I didn't have to restart X. Now<br>
to the interesting observation. This time I did not get the error window<br>
that I got under step 4. I other words the set shell commands are<br>
available when ~/.profile is sourced. They are not, however, when I<br>
fire up a command window. If the sourcing of ~/.profile is a part of<br>
the same process running the initialisation file this is the expected<br>
outcome. But the export of the commands has failed.<br>
<br>
<br>
/Gösta<br>
<br>
</div>
<br>
</div>
<br>
<p></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Från:</b> Gunnar Hjalmarsson <gunnarhj@ubuntu.com><br>
<b>Skickat:</b> den 6 maj 2019 11:58:56<br>
<b>Till:</b> Gösta Ljungdahl; Ubuntu Developers<br>
<b>Ämne:</b> Re: SV: compatibility issue in environment-modules version 4.1.1-1</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText">On 2019-05-06 09:36, Gösta Ljungdahl wrote:<br>
> On 2019-05-05 22:35, Gunnar Hjalmarsson wrote:<br>
>> From a quick look at the code in environment-modules I see that it<br>
>> seems to test for the BASH_VERSION variable. That makes me think of<br>
>> this change of LightDM:<br>
>> <br>
>> <a href="https://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/revision/2168/debian/lightdm-session" id="LPlnk314759" previewremoved="true">
https://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/revision/2168/debian/lightdm-session</a>
<br>
>> <br>
>> which was made in response to:<br>
>> <br>
>> <a href="https://launchpad.net/bugs/1482641" id="LPlnk837214" previewremoved="true">
https://launchpad.net/bugs/1482641</a>
<div id="LPBorder_GT_15572261943790.558744026499023" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15572261943750.3184051724233691" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15572261943750.354406610523614" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15572261943750.7055395440697493"></div>
<div id="LPTitle_15572261943760.47385510710817624" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15572261943760.9261379934434291" style="text-decoration: none;" href="https://launchpad.net/bugs/1482641" target="_blank">Bug #1482641 “Lightdm (and GDM) source .profile as bash, indirec...” : Bugs : gdm package : Ubuntu</a></div>
<div id="LPMetadata_15572261943770.7471296709105684" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
launchpad.net</div>
<div id="LPDescription_15572261943790.24859315073042265" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
The fix for https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/678421 leads to `.profile` being sourced by bash instead of dash. This leads `.bashrc` being sourced indirectly via .profile. IMHO, `.bashrc` should not be sourced even *once* in this situation.
I suggest that sourcing .profile actually be done with BASH_VERSION unset: BASH_VERSION= . "$CONFIG" At the very least, a check should be done whether bash is the user's login shell. It can be done thus: [ "$SHELL"
!= "/bin/bas...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
>> <br>
>> Can this possibly be a reason for the confusion you have observed?<br>
> > All I really know is that at some point in the initialization process<br>
> dash comes into play and is not equal to the task. I know this<br>
> because the initialization works as expected if I change /bin/sh to<br>
> point to /bin/bash.<br>
<br>
Right. But it could be useful to know what happens if you<br>
<br>
1. Change the /bin/sh symlink back to point to dash, and<br>
<br>
2. (assuming that MINT uses LightDM) edit /usr/sbin/lightdm-session and<br>
change the line<br>
<br>
BASH_VERSION= . "$CONFIG_FILE" 2>"$ERR"<br>
<br>
to<br>
<br>
. "$CONFIG_FILE" 2>"$ERR"<br>
<br>
-- <br>
Gunnar Hjalmarsson<br>
<a href="https://launchpad.net/~gunnarhj" id="LPlnk355712" previewremoved="true">https://launchpad.net/~gunnarhj</a>
<div id="LPBorder_GT_15572261942070.31833462843528515" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15572261942010.9916611153726698" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15572261942030.09372185753466711" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15572261942040.4729501478210413"></div>
<div id="LPTitle_15572261942040.4572520491866461" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15572261942040.31273275525270794" style="text-decoration: none;" href="https://launchpad.net/~gunnarhj" target="_blank">Gunnar Hjalmarsson in Launchpad</a></div>
<div id="LPMetadata_15572261942050.2749782638863927" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
launchpad.net</div>
<div id="LPDescription_15572261942070.4752569811171138" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Ubuntu wiki page: https://wiki.ubuntu.com/GunnarHj</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</div>
</span></font></div>
</body>
</html>