LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   'su' command in MATE Terminal gives me a 'Slack (32 Bit)$' bash prompt (14.2 Multilib) (https://www.linuxquestions.org/questions/slackware-14/su-command-in-mate-terminal-gives-me-a-slack-32-bit-%24-bash-prompt-14-2-multilib-4175689116/)

ygtoz 01-23-2021 08:24 AM

'su' command in MATE Terminal gives me a 'Slack (32 Bit)$' bash prompt (14.2 Multilib)
 
I have installed 64-bit Slackware 14.2 on a laptop (iGPU). It is a very new installation (reinstalled yesterday), and the most relevant thing I have done to my install is probably that I enabled multilib support (through slackpkg+) as instructed in the Slackware beginner guide. I am also using MATE.

Regular bash prompt works perfectly both as regular and root user. When I use the su or su - commands, however, the (bash) shell prompt goes from
Code:

ygtoz@Slack:~$
to
Code:

root@Slack (32bit):~#
for example. whereis bash does not return any clearly 32-bit executables, though /usr/bin/32 is at the top of my $PATH. I have root, a regular user account (let's call it ygtoz) and another regular account called 'lfs', and no other user accounts. Both in the regular shell prompt and in any su environment, regardless of user, echo $SHELL returns /bin/bash.

Opening a Root Terminal through MATE, I can switch to the 'ygtoz' account (su - ygtoz or su ygtoz) and get the regular shell prompt I expect (without any mentions of 32bit), which is the only exception to this behavior that I can find. This happens regardless of whether or not the Root Termnal is run as a login shell.

I have changed the prompt color through ~/.bashrc (for both my ygtoz and root accounts), and the only time this is sustained in a su environment is when, as above, I open a MATE Root Terminal and su (-) to my regular ygtoz account. This also prints /dev/pts/1: Operation not permitted before displaying the (correct) prompt. When I run the Root Terminal as a login shell, this is still true (the original prompt has (32bit) and the su environment prompt does not), and then I also get the error /dev/pts/3: Operation not permitted .

I have also realized that whenever I run my MATE Root Terminal as a login shell, it starts with the
Code:

root@Slack (32bit):~#
prompt. If I then run 'bash', I get my regular prompt back. In comparison, my colorful prompt appears in the regular terminal (as ygtoz user) regardless of whether I use a login shell or not. I expect that this means both users source their respective ~/.bashrc files but executing Root Terminal as a login shell has a call somewhere that supersedes /root/.bashrc.

My questions:
1. Am I somehow running a 32-bit build of bash through su?
2. If so (or if not), should I be worried about anything? As you might have guessed, the 'lfs' user is for Linux from Scratch.
3. How can I fix this? Even after changing and exporting $PATH so that /bin is the first directory in it, this behavior repeats.
4. Does this mean I borked my multilib install and need to remove/change things on that front? slackpkg upgrade-all shows some gcc/glibc packages for updating, but slackpkg upgrade multilib shows nothing so perhaps I messed something up there.

Alien Bob 01-23-2021 10:10 AM

I think you made /etc/profile.d/32dev.sh executable. That is wrong.

ygtoz 01-23-2021 10:32 AM

Quote:

Originally Posted by Alien Bob (Post 6210995)
I think you made /etc/profile.d/32dev.sh executable. That is wrong.

Got it in one! Thank you so much, that fixed it. Also thank you for your work in other parts of the documentation.

Are there any other files in that directory (in a default full Slackware install) that must not be set as executable, or a place where I could find that information?


All times are GMT -5. The time now is 08:23 PM.