<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi, Gunnar,</p>
<p><br>
</p>
<p>Tested editing /etc/profile.d/modules.sh to source /usr/share/modules/init/bash by default i.e. commented out the line
<br>
</p>
<p><br>
</p>
<p>. /usr/share/modules/init/sh</p>
<p><br>
</p>
<p>and put in</p>
<p><br>
</p>
<p>. <span>/usr/share/modules/init/bash</span></p>
<p><span><br>
</span></p>
<p><span>but it was not sufficient.</span> Apparently dash comes in at a later stage.</p>
<p><br>
</p>
<p>Cheers,</p>
<p>Gösta<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Från:</b> Gösta Ljungdahl<br>
<b>Skickat:</b> den 8 maj 2019 11:26:29<br>
<b>Till:</b> Gunnar Hjalmarsson; ubuntu-devel-discuss@lists.ubuntu.com<br>
<b>Ämne:</b> SV: compatibility issue in environment-modules version 4.1.1-1</font>
<div> </div>
</div>
<div>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi, Gunnar!</p>
<p><br>
</p>
<p>No. I doubt that modules.sh is a Debian invention. A file with the exact same content lives in the subdirectory .../init/ of the installation if done from Sourceforge sources for the same version 4.1.1. There, however, its name is profile.sh and it is suggested
that a symlink modules.sh pointing to that file be put in /etc/profile.d/ for on boot initialisation. Debian has moved the entire file as it seems.</p>
<p><br>
</p>
<p>The corresponding file of current version 4.2.3 at Sourceforge is a bit more elaborate and has the following content:</p>
<p>---<br>
</p>
<p></p>
<div># get current shell name by querying shell variables or looking at parent<br>
# process name<br>
if [ -n "${BASH:-}" ]; then<br>
shell=${BASH##*/}<br>
elif [ -n "${ZSH_NAME:-}" ]; then<br>
shell=$ZSH_NAME<br>
else<br>
shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=))<br>
fi</div>
<div>...<br>
</div>
---
<p></p>
<p><br>
</p>
<p>instead of just the last line in the else statement. I guess it boils down to the same effect in Ubuntu or Mint as still the software is not correctly initialised.</p>
<p><br>
</p>
<p>I am CC:ing this and will forward your findings to Xavier Delaruelle who is one of the source maintainers. He wanted me to put in some tracing lines in various files of the distro package which I will presently do. Hopefully, in the not too distant future
things will improve. <br>
</p>
<p><br>
</p>
<p>Cheers,</p>
<p>Gösta<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Från:</b> Gunnar Hjalmarsson <gunnarhj@ubuntu.com><br>
<b>Skickat:</b> den 8 maj 2019 02:40:38<br>
<b>Till:</b> Gösta Ljungdahl; ubuntu-devel-discuss@lists.ubuntu.com<br>
<b>Ämne:</b> Re: 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">Hi again, Gösta!<br>
<br>
I do not know how environment-modules is thought to work, but I did a <br>
small test to figure out the starting point with sourcing the <br>
/etc/profile.d/modules.sh file.<br>
<br>
The first line in that file reads:<br>
<br>
shell=$(/usr/bin/basename $(/bin/ps -p $$ -ocomm=))<br>
<br>
I put that line in a temporary .sh file in /etc/profile.d on my machine, <br>
and let it print the contents of the $shell variable.<br>
<br>
* Doing a graphical login using LightDM made $shell be assigned the<br>
value "lightdm-session" (the script which sources files in<br>
/etc/profile.d is /usr/sbin/lightdm-session).<br>
<br>
* Doing a graphical login using GDM made $shell be assigned the value<br>
"Xsession" (the script which sources files in /etc/profile.d is<br>
/etc/gdm3/Xsession).<br>
<br>
* Logging in to a TTY made $shell be assigned the value "bash".<br>
<br>
This means that in case of graphical logins, modules.sh will always pick <br>
/usr/share/modules/init/sh for initialization. Its design is apparently <br>
not thought for the kind of sourcing by the display manager which <br>
happens on Ubuntu (and Ubuntu based) systems.<br>
<br>
I suppose (not tested, though) that one way to work around this is to <br>
edit modules.sh so it sources /usr/share/modules/init/bash by default <br>
instead of /usr/share/modules/init/sh . Your initial solution, i.e. <br>
making the /bin/sh symlink point to bash instead of dash, is another way.<br>
<br>
At this time I don't think that my initial theory (editing <br>
/usr/sbin/lightdm-session) makes a difference.<br>
<br>
If you find that editing modules.sh as I suggested fixes the issue, I'd <br>
say that we have nailed the cause of the problem. modules.sh seems to be <br>
a Debian invention, so in that case I'd suggest that you report it <br>
there. Hopefully the Debian maintainer is willing to make modules.sh a <br>
bit more intelligent. :)<br>
<br>
-- <br>
Gunnar Hjalmarsson<br>
<a href="https://launchpad.net/~gunnarhj">https://launchpad.net/~gunnarhj</a><br>
</div>
</span></font></div>
</body>
</html>