diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2015-12-13 23:21:44 +0000 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2015-12-13 23:21:44 +0000 |
commit | d2b3757bed7ca41a881d3cc04b7914a49a077803 (patch) | |
tree | ecb6f64ced287263fa4492319965386bbb13e6ec | |
parent | metadata: refresh cache (diff) | |
download | portage-d2b3757bed7ca41a881d3cc04b7914a49a077803.tar.xz |
factory-default/net-misc/openssh: die does not exist in init scripts
-rwxr-xr-x | factory-default/net-misc/openssh/etc/init.d/ssh-agent | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/factory-default/net-misc/openssh/etc/init.d/ssh-agent b/factory-default/net-misc/openssh/etc/init.d/ssh-agent index d43f1b5d..4e33204f 100755 --- a/factory-default/net-misc/openssh/etc/init.d/ssh-agent +++ b/factory-default/net-misc/openssh/etc/init.d/ssh-agent @@ -19,21 +19,32 @@ checkconfig() { start() { checkconfig || return 1 + if [[ -e "${SSH_AGENT_SOCK}" ]] ; then + einfo "Removing stale ${SSH_AGENT_SOCK}" + rm -f "${SSH_AGENT_SOCK}" + eend $? + return 1 + fi + ebegin "Starting ssh-agent (${SSH_AGENT_USER})" start-stop-daemon --start \ --user "${SSH_AGENT_USER}" \ --pidfile "${pidfile}" \ --exec /usr/bin/ssh-agent \ -- -a "${SSH_AGENT_SOCK}" \ - > "${envfile}" \ - || die "ssh-agent fail to start" - eend $? + > "${envfile}" + + if [[ $? != 0 ]] ; then + eend 1 "Fail to start ssh-agent" + return 1 + fi source "${envfile}" > /dev/null rm -f "${envfile}" if [[ -z ${SSH_AGENT_PID} ]] ; then - die "ssh-agent generate to PID" + eend 1 "ssh-agent failed to generate a PID" + return 1 fi echo "${SSH_AGENT_PID}" > "${pidfile}" |