Seems like the other issue is that the default .profile sources .bashrc if $BASH_VERSION is set. But $BASH_VERSION is set even if bash is invoked as /bin/sh. .bashrc is designed only for sourcing by bash, not bash in posix mode, or any other shell, given that bash itself does not source .bashrc by default in that mode.
A thought is it should do
if [ -n "$BASH_VERSION" ] && [ -n "$POSIXLY_CORRECT" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
but your point is still valid: lightdm could handle the user's shell exiting much better.
Seems like the other issue is that the default .profile sources .bashrc if $BASH_VERSION is set. But $BASH_VERSION is set even if bash is invoked as /bin/sh. .bashrc is designed only for sourcing by bash, not bash in posix mode, or any other shell, given that bash itself does not source .bashrc by default in that mode.
A thought is it should do
if [ -n "$BASH_VERSION" ] && [ -n "$POSIXLY_CORRECT" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
but your point is still valid: lightdm could handle the user's shell exiting much better.