~alpine/users

2 2

Default shell is not executed as a login shell

José Alberto Orejuela García <libre@josealberto4444.com>
Details
Message ID
<47778e2d238ff3ff41c5238c4c459780@josealberto4444.com>
DKIM signature
missing
Download raw message
Hello,

I have just installed (sys mode) Alpine in a Raspberry Pi 3B+ (using 
aarch64 image). The problem I have is that /etc/profile is never 
sourced, so the environment variables inside /etc/profile and 
/etc/profile.d scripts are never set. I suspect that it is because the 
default shell (ash, in this case) is not run as a login shell (ash -l), 
but as a regular interactive shell. Is this a bug? Or how can I change 
this behaviour?

Thanks.
José Alberto Orejuela García <libre@josealberto4444.com>
Details
Message ID
<aa6dfbe20a01f386baa0c99fb1d933c6@josealberto4444.com>
In-Reply-To
<47778e2d238ff3ff41c5238c4c459780@josealberto4444.com> (view parent)
DKIM signature
missing
Download raw message
On 2021-06-03 02:20, José Alberto Orejuela García wrote:
> Hello,
> 
> I have just installed (sys mode) Alpine in a Raspberry Pi 3B+ (using
> aarch64 image). The problem I have is that /etc/profile is never
> sourced, so the environment variables inside /etc/profile and
> /etc/profile.d scripts are never set. I suspect that it is because the
> default shell (ash, in this case) is not run as a login shell (ash
> -l), but as a regular interactive shell. Is this a bug? Or how can I
> change this behaviour?
> 
> Thanks.

I found my problem. I was starting an SSH session with a user whose 
default shell was fish (horrible idea). I thought that, when doing `su` 
and changing to root, the next shell should be also executed as a login 
shell, and that is not true. Only the first shell was executed as a 
login shell (which turned out to do nothing as fish does not follow 
standards very well).

Summing up, changing the user default shell to ash solved the problem 
when using SSH, and I tested directly in the raspberry loging in as the 
root user and ash is also executed as a login shell. No problems on 
Alpine side but mine. =P

Sorry for the inconvenience.
Details
Message ID
<20210611145509.qw5ixth7oyyuecuv@wolfsden.cz>
In-Reply-To
<aa6dfbe20a01f386baa0c99fb1d933c6@josealberto4444.com> (view parent)
DKIM signature
missing
Download raw message
On 2021-06-03 12:10:40 +0200, José Alberto Orejuela García wrote:
> I thought that, when doing `su` and changing to root, the next shell
> should be also executed as a login shell, and that is not true.

For future reference, I believe `su -` would invoke the login shell.

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
Reply to thread Export thread (mbox)