Hi,
when I feed utrans the gcr ssh service file, I get the following openRC
service as result:
#!/sbin/openrc-run
# Generated by /usr/bin/utrans from:
# 3f5912155b6468fd682eef487039c1c065978d092b1139657c8bf75a317fb4ca /usr/lib/systemd/user/gcr-ssh-agent.socket
# 62f5646d4d8e3c13b8767d43b58a5e3a886388cd9549954a7ee0c41e180a55d4 /usr/lib/systemd/user/gcr-ssh-agent.service
description="GCR ssh-agent wrapper."
supervisor="supervise-daemon"
command="/usr/bin/socket-activate"
command_args="--unix::${XDG_RUNTIME_DIR:-/run}/gcr/ssh -- /usr/libexec/gcr-ssh-agent --base-dir ${XDG_RUNTIME_DIR:-/run}/gcr"
start_pre() {
mkdir -p -m 0700 ${XDG_RUNTIME_DIR:-/run}/gcr
}
start_post() {
/usr/bin/systemctl --user set-environment SSH_AUTH_SOCK=${XDG_RUNTIME_DIR:-/run}/gcr/ssh || true
}
start_post has a systemctl invocation; while a systemctl alternative
exists that's not tied to systemd IMO this is not what we desire here.
SSH_AUTH_SOCK should be exported by the service, and unset if the
service terminates. Right now, I have this as (local) workaround
(without a service):
# hack to get gcr-sshagent to work
# FIXME: convert to openRC service
exec mkdir -p /run/user/1000/gcr
exec /usr/libexec/gcr-ssh-agent --base-dir=/run/user/1000/gcr
and
export SSH_ASKPASS=/usr/libexec/gcr4-ssh-askpass
export SSH_AUTH_SOCK=/run/user/1000/gcr/ssh
I realize utrans should only serve as base to quickly get services that
work however.
Thanks for maintaining openRC and utrans!
best,
werdahias