Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tapping into the environment just before user shell starts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3698
Location: Rasi, Finland

PostPosted: Thu Nov 14, 2024 9:12 am    Post subject: Tapping into the environment just before user shell starts Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum