[arch-general] gpg-agent, ssh keys, and systemd --user

Robbie Smith zoqaeski at gmail.com
Thu Apr 11 08:50:23 EDT 2013


On 11/04/13 15:11, Simon Gomizelj wrote:
> systemd --user runs in its own separate login/cgroup. I doubt
> environmental variables set with `systemctl --user set-environment`
> going to be available outside of that login/cgroup. I doubt they're
> even made available to anything outside of future processes spawned by
> systemctl.
>
> So it'll all depend on how you're using user sessions. Anyhow...
>
This might be it.

But what’s confused me is that the variables are written to that info 
file, and I should be able to export them manually by adding something 
like this to my ~/.zshrc:

if (( $+commands[gpg-agent] )); then
	local InfoFile=/run/user/$(id -u)/gpg-agent.info
	if [[ -s $InfoFile ]]; then
		eval "$(cat $InfoFile)"
	fi
	unset InfoFile
fi

Strangely enough, this doesn’t seem to work. What’s the difference 
between exporting variables in /etc/profile.d/ and ~/.zshrc?


More information about the arch-general mailing list