Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mate-session removes BASH_FUNC_*%% style varibales from environment #209

Open
fries opened this issue Apr 28, 2019 · 1 comment
Open

mate-session removes BASH_FUNC_*%% style varibales from environment #209

fries opened this issue Apr 28, 2019 · 1 comment

Comments

@fries
Copy link

fries commented Apr 28, 2019

We use environment modules (http://modules.sourceforge.net/) for managing extra software on our desktops. The modules command is initialized in
/etc/profile.d/modules.sh. This shell profile exports env variables as well as
the shell functions. Those exported shell functions are passed as env variables
in the form of BASH_FUNC_*%%.

Expected behaviour

BASH_FUNC_*%% style environment variables should be passed
through to Mate applications like the panel and mate-terminal.

Actual behaviour

BASH_FUNC_*%% style environment variables are stripped from the
environment.

Steps to reproduce the behaviour

  1. Install Linux Mint 19
  2. apt-get install environment-modules
  3. Log out and in again
  4. Type 'module' => module: command not found

If you source . /etc/profile.d/modules.sh, then the module
command works as expected.

MATE general version

1.20

Package version

mate-session-manager-1.20.0-1

Linux Distribution

Linux Mint 19 (Tessa)

Link to downstream report of your Distribution

n/a

@GregDavidson
Copy link

GregDavidson commented Nov 7, 2022

This is a very bad regression which has been ignored for years. After the display manager correctly sources the system and the user's profiles and establishes the environment including the exported shell functions, it invokes mate-session which at some point invokes sh instead of the shell specified in the user's account. Alas, some systems, including Ubuntu and Mint now link /bin/sh to link to dash which as of version 0.5.8 removes any variables it considers syntactically improper from the environment, including those for export bash shell functions. The workaround is to sudo dpkg-reconfigure dash or to sudo rm /bin/sh; sudo ln bash /bni/sh on those systems. To anyone who'd like to argue that this is not mate-session's problem, please note that it is mate-session which is selecting the sh shell instead of the shell specified by the user's account and mate-session has not documented this and the problems it may cause. Does mate-session require an sh-compatible shell? Does it need to exec a shell at all, and if so, why? If it needs a shell process, could it use the shell specified in the user's account where suitable and/or allow a way for users to specify which shell mate-session should use? In any case, please: document the problem immediately, as it is causing a lot of problems and is difficult to track down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants