Zucca Moderator
Joined: 14 Jun 2007 Posts: 3698 Location: Rasi, Finland
|
Posted: Thu Nov 14, 2024 9:12 am Post subject: Tapping into the environment just before user shell starts |
|
|
So my quest is to be able to run some commands (shell script) and export user specific environment variables just before user shell starts. So sh/bash profile/rc scripts are out.
I've been using pam_exec to perform some XDG temp dir initializations before user shell starts, but I cannot export environment variables from there, since the pam_exec will exit (lose all the exported variables) and then the parent process will exec user shell.
My solution has been to use custom /etc/security/pam_env.conf, which does allow to set per user environment variables.
Then problem is, that if I make this into a package, it cannot simply override /etc/security/pam_env.conf, so I'd need a separate config file, but pam_env does not have any pam_env.d -like directory to support drop-in configs.
I'm making this so that I could simply install "fully seatded" system (meaning no systemd-logind or elogind) to my other boxes without too much touching of config files.
Thanks in advance. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|