Artix Linux Forum

Init systems => OpenRC => Topic started by: surv on 11 March 2025, 22:24:18

Title: .zprofile sourced 3 times at login
Post by: surv on 11 March 2025, 22:24:18
Hi !
Since my last update with pacman -Syu yesterday, my .zprofile is sourced 3 times at login, with this pstree trace :
Code: [Select]
Sourcing .zprofile from ~ at Tue Mar 11 10:10:58 PM CET 2025
init---supervise-daemo---openrc-user---zsh---pstree


Sourcing .zprofile from ~ at Tue Mar 11 10:11:06 PM CET 2025
init---supervise-daemo---openrc-user---zsh---pstree


Sourcing .zprofile from ~ at Tue Mar 11 10:11:06 PM CET 2025
init---supervise-daemo---login---zsh---pstree

It seems to come from the new openrc user feature.
Any idea ?

Thanks !

EDIT: I found this workaround, but it's not perfect...
Code: [Select]
if pstree -s $$ | grep -q 'login'; then
   # content of .zprofile
fi
Title: Re: .zprofile sourced 3 times at login
Post by: navi on 26 March 2025, 01:53:05
openrc-user does start a command as your shell, once when you first log in, again when you last logout

it does so to allow you to override variables such as XDG_CONFIG_HOME, or even XDG_RUNTIME_DIR.

on my system, i do `if [[ "$(tty)" = "/dev/tty1" ]]; then login_stuff; fi`