• eleijeep@piefed.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 天前

    It sounds like you’ve looked into this before, so I’ll ask you: what is the use-case for per-user environment variables that can’t be achieved trivially through ~/.bashrc or /etc/profile ?

    It sounds to me like the problem they want to solve is that there is some piece of information which needs to be present in the environment for every process that a user runs regardless of the context it was executed from (eg. $DBUS_SESSION_BUS_ADDRESS)?

    In which case it would surely be served better by being contained in a config file in a standard location where it can be read by every process that needs that info instead of the executing process having to know the information and pass it in the environment, for every possible caller and calling context.

    • exu@feditown.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 天前

      /etc/profile also needs root to edit. I agree that there should be a config file in a standard location, my issue is that using $(your local shell config) is barely a standard.
      For this purpose PAM’s /etc/environment works great in the global context, but there’s no PAM equivalent for each user.
      Systemd has global and per user environment stuff, but last I checked this only worked for systemd services