[systemd-devel] How do I make some environment variables available to user-mode unit?

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue May 13 14:10:33 PDT 2014


On Tue, May 13, 2014 at 10:21:07PM +0300, Andrei Dziahel wrote:
> Hey list,
> 
> I've create socket-activated user-mode unit[1] that sets up a SSH
> tunnel, but it fails to start because ssh is unaware of ssh-agent
> (gnome-keyring) because of empty environment. Is this possible to feed
> ssh-agent-related environment variables to foo-tunnel.service making
> gnome-keyring ask me to unlock openssh key?
> 
>   [1]: https://gist.github.com/develop7/bdab20c0d9658f0d2b08
systemctl import-environment should do the trick. It's only avilable since
systemd-209, but if you're using something earlier, systemctl set-environent
would also work.

Zbyszek


More information about the systemd-devel mailing list