<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=7777&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] Excalibur + lightdm: How do I modify the PATH globally?]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=7777</link>
		<description><![CDATA[The most recent posts in [SOLVED] Excalibur + lightdm: How do I modify the PATH globally?.]]></description>
		<lastBuildDate>Sun, 01 Feb 2026 23:24:41 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] Excalibur + lightdm: How do I modify the PATH globally?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61720#p61720</link>
			<description><![CDATA[<p>Here are my final investigation notes before I clean up and move on. Perhaps someone will find this useful.</p><p><strong>* Slim notes</strong></p><p>- The reason why using slim triggers /etc/profile to run is because the &quot;login_cmd&quot; defined in /etc/slim.conf explicitly runs bash as a login shell. Bash then runs /etc/profile.</p><div class="codebox"><pre><code>login_cmd           exec /bin/bash -login /etc/X11/Xsession %session</code></pre></div><p>- /etc/slim.conf does have a &quot;default_path&quot; setting. But if you append a path to this setting, it doesn&#039;t appear to work. That&#039;s because the bash login runs /etc/profile, which overwrites the current PATH anyway.</p><p>You can confirm that the &quot;default_path&quot; does work by adding a dummy path to &quot;default_path&quot;:</p><div class="codebox"><pre><code>default_path        /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/dbg/slimconf</code></pre></div><p>then printing the PATH variable out to a file at the very top of /etc/profile:</p><div class="codebox"><pre><code>echo &quot;Top of /etc/profile, PATH is $PATH&quot; &gt;&gt; /tmp/dbglog.txt</code></pre></div><p>You&#039;ll see in the log file that &quot;/dbg/slimconf&quot; is in the PATH, confirming that slim really is using &quot;default_path&quot;.</p><p><strong>* Lightdm notes</strong></p><p>- I downloaded the lightdm source code, then compiled and debugged it. The source code hardcodes the root and regular users&#039; PATH variable:</p><div class="codebox"><pre><code>- session-child.c, session_child_run():

    /* Set POSIX variables */
    if (user_get_uid (user) == 0)
      pam_putenv (pam_handle, &quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&quot;);
    else
      pam_putenv (pam_handle, &quot;PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games&quot;);
    pam_putenv (pam_handle, g_strdup_printf (&quot;USER=%s&quot;, username));
    pam_putenv (pam_handle, g_strdup_printf (&quot;LOGNAME=%s&quot;, username));
    pam_putenv (pam_handle, g_strdup_printf (&quot;HOME=%s&quot;, user_get_home_directory (user)));
    pam_putenv (pam_handle, g_strdup_printf (&quot;SHELL=%s&quot;, user_get_shell (user)));</code></pre></div><p>I added a dummy path and confirmed that the PATH variable really comes from this code, which answers my questions. And it also means that unlike slim, there&#039;s currently no external way to change these paths, other than recompiling the code.</p><p>So using ~/.xsessionrc to modify the PATH seems to be the best option so far.</p><p>- The reason why lightdm doesn&#039;t run /etc/profile is because it doesn&#039;t run bash at all. Instead, it directly runs another app &quot;/sbin/lightdm-gtk-greeter&quot;. I couldn&#039;t figure out where lightdm gets the greeter path from.</p>]]></description>
			<author><![CDATA[dummy@example.com (Eeqmcsq)]]></author>
			<pubDate>Sun, 01 Feb 2026 23:24:41 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61720#p61720</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Excalibur + lightdm: How do I modify the PATH globally?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61701#p61701</link>
			<description><![CDATA[<p>I think I found that same archlinux page after my initial post, and I also couldn&#039;t get /etc/xprofile to work. I had also thought about appending the path in two places to handle all of my cases. So it looks like we&#039;ve been down the same path of thinking.</p><p><strong>* Solution for lightdm</strong></p><p>- Create a .sh file in /etc/profile.d, append /usr/sbin to the PATH variable. This covers the tty/telnet/ssh cases.<br />- Create a local file ~/.xsessionrc, append to the PATH variable. This covers the MATE Terminal and double-click-on-script cases.</p><p>A quick test of all of my test cases running &quot;ifconfig&quot; without sudo confirms this solution works for me. I&#039;ll marked this as solved.</p>]]></description>
			<author><![CDATA[dummy@example.com (Eeqmcsq)]]></author>
			<pubDate>Sun, 01 Feb 2026 03:59:10 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61701#p61701</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Excalibur + lightdm: How do I modify the PATH globally?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61698#p61698</link>
			<description><![CDATA[<p>I see in slim.conf: <span class="bbc">default_path&#160; &#160; &#160; &#160; /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games</span><br />but I&#039;m not seeing anything similar in lightdm.conf.</p><p>Evidently, TTY login gets path from /etc/profile, then ~/.profile - both of which seem to be ignored by lightdm</p><p>I know it&#039;s not answering your questions (I don&#039;t know the answers), but for now you could use a combination of /etc/profile (for tty) and ~/.xsessionrc (for X)</p><p>(edit)<br />From this page <a href="https://wiki.archlinux.org/title/LightDM" rel="nofollow">https://wiki.archlinux.org/title/LightDM</a> </p><div class="quotebox"><blockquote><div><p>LightDM starts your display and does not source your shell. LightDM launches the display by running a wrapper script and that finally exec&#039;s your graphic environment. By default, /etc/lightdm/Xsession is run.<br />5.3.1 Environment variables<br />The script checks and sources /etc/profile, ~/.profile, /etc/xprofile and ~/.xprofile, in that order.</p></div></blockquote></div><p>I was not able to get xprofile to work, either.&#160; I&#039;m wondering if something is missing or misconfigured by default, or if this is a bug.</p>]]></description>
			<author><![CDATA[dummy@example.com (rbit)]]></author>
			<pubDate>Sun, 01 Feb 2026 03:10:02 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61698#p61698</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Excalibur + lightdm: How do I modify the PATH globally?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=61692#p61692</link>
			<description><![CDATA[<p>I want to add &quot;/usr/sbin&quot; to the PATH so I (or my scripts) can run a few sbin commands without needing sudo (examples: ifconfig, showmount). This is mainly for personal convenience.</p><p>In slim + Xfce, I can create a .sh file in /etc/profile.d, and append to the PATH:</p><p>&#160; <span class="bbc">PATH=$PATH:/example/path</span></p><p>But this doesn&#039;t work with lightdm. My testing shows that lightdm doesn&#039;t run /etc/profile, which means none of the scripts in /etc/profile.d are run. And I&#039;ve confirmed that the problem is lightdm, because when I switched from slim + Xfce to lightdm + Xfce, /etc/profile is NOT run anymore.</p><p><strong>* Solutions that don&#039;t work for me</strong><br />&#160; <br />- Use ~/.xsessionrc. This doesn&#039;t work because TTY (CTRL+ALT+F1), ssh, or telnet does NOT run ~/.xsessionrc.</p><p>- Use ~/.bashrc. This doesn&#039;t work if I double click on a script file to launch it. ~/.bashrc is NOT run.<br />&#160; <br />- Use /etc/environment. This also doesn&#039;t work in TTY, ssh, or telnet. It also requires me to hardcode the rest of the system paths, because /etc/environment does not support script syntax, so I can&#039;t append to an existing PATH value.</p><p>- Maybe I can find where PATH is first initialized globally, and append my path there. I&#039;ve tried:<br />&#160; - The initial PATH value is &quot;/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games&quot;, and I&#039;ve confirmed that even though /etc/profile sets the PATH to this string, this string is ALREADY set to PATH at the start of /etc/profile. Where is it coming from?<br />&#160; - I searched /etc for &quot;/usr/games&quot;, and the only file that could make sense is /etc/login.defs. But when I manually appended a dummy path &quot;/dbg/logindefs&quot;, and rebooted, the dummy path is NOT in PATH.<br />&#160; - I extracted the ramdisk /boot/initrd.img-6.12.63+deb13-amd64, and did not find &quot;/usr/games&quot;. Now I&#039;m out of ideas.</p><p><strong>* Questions</strong></p><p>? Where can I append to the PATH globally?</p><p>? Also, where exactly is the PATH first initialized?</p>]]></description>
			<author><![CDATA[dummy@example.com (Eeqmcsq)]]></author>
			<pubDate>Sun, 01 Feb 2026 01:05:57 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=61692#p61692</guid>
		</item>
	</channel>
</rss>
