Created
October 24, 2014 00:32
-
-
Save jinmingjian/3e9b719a7b9b749d8d47 to your computer and use it in GitHub Desktop.
ssh-agent.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OpenSSH private key agent | |
Wants=environment.target | |
Before=environment.target | |
IgnoreOnIsolate=true | |
[Service] | |
Type=forking | |
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket | |
#PIDFile=%t/ssh-agent.pid | |
ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK | |
ExecStartPost=/usr/bin/systemctl --user set-environment SSH_AUTH_SOCK=${SSH_AUTH_SOCK} | |
ExecStartPost=/bin/sh -c "ps x -o pid,comm|grep ssh-agent|cut -d' ' -f1 > %t/ssh-agent.pid" | |
#ExecStop=/usr/bin/ssh-agent -k | |
ExecStopPost=/bin/rm ${SSH_AUTH_SOCK} | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment