From 684d1f3b66543f15b2826206a65264c24abcc9a6 Mon Sep 17 00:00:00 2001 From: Lian Drake Date: Thu, 24 Oct 2024 01:37:21 -0400 Subject: [PATCH] Updated, added ssh-agent runit service --- config/runit/service/.gitkeep | 0 config/runit/sv/ssh-agent | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 config/runit/service/.gitkeep create mode 100755 config/runit/sv/ssh-agent diff --git a/config/runit/service/.gitkeep b/config/runit/service/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/config/runit/sv/ssh-agent b/config/runit/sv/ssh-agent new file mode 100755 index 000000000..490478ad1 --- /dev/null +++ b/config/runit/sv/ssh-agent @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Start ssh-agent from runit +# +# Author: Dave Eddy +# Date: August 29, 2018 +# License: MIT + +file=~/.ssh/ssh-agent-env + +exec > "$file" + +echo "# started $(date)" + +# For some reason, this line doesn't get emitted by ssh-agent when it is run +# with -d or -D. Since we are starting the program with exec we already know +# the pid ahead of time though so we can create this line manually +echo "SSH_AGENT_PID=$$; export SSH_AGENT_PID" + +exec ssh-agent -D