Re: Scripts in the '/etc/profile.d/' directory
| Newsgroups | gmane.linux.lfs.beyond.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2025-09-24 at 04:05 -0300, Jamenson Espindula wrote: > Em qua., 24 de set. de 2025 às 00:07, Bruce Dubbs > <[email protected]> escreveu: > > > > I think there are times when using a display manager, ~/.bash_profile is not run, so > > the /etc/profile.d/ scripts are not run. If that is the case then I think ~/.bashrc > > does need something like 'if some-condition; then ~/.bash_profile; fi' or whatever > > the program that does the login needs to run 'bash --login'. > > > > You do NOT want .bashrc to run the /etc/profile.d/ scripts every time it is invoked. > > > > -- Bruce > > > > > > -- > > http://lists.linuxfromscratch.org/sympa/info/blfs-dev > > Unsubscribe: See the above information page > > I have a 'more elegant' solution! > > I did remember that I faced that situation and I wrote a little text > (never published) about. > > First, you create a '.screenrc' file in your home directory. > > Second, you put the following inside that file: > defshell -"${SHELL}" > > Explanations: > > The environment variable 'SHELL' will be expanded by GNU Screen. The > value of that environment variable should be '/usr/bin/bash'. > > Note the minus sign '-' ahead of the environment variable: it tells > the GNU Screen to initiate a 'login shell', as if 'bash --login' had > been invoked. The result is '-/usr/bin/bash', a 'login shell' that > reads the '/etc/profile' file and, by consequence, all the scripts in > the '/etc/profile.d/' directory! I clearly remember you already proposed that some times ago and I already NACKed that for the book. Again it's not acceptable for the book to configure screen to start a login shell by default. You are *not* logging in when you invoke screen. -- Xi Ruoyao <[email protected]> -- http://lists.linuxfromscratch.org/sympa/info/blfs-dev Unsubscribe: See the above information page