This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.5.24: rxvt or console fail to shutdown due to ssh -f still running despite setsid()
- From: "Ken Shaffer" <strobelight dot audio at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 9 Apr 2007 17:51:24 -0400
- Subject: Re: 1.5.24: rxvt or console fail to shutdown due to ssh -f still running despite setsid()
I have just checked the source for the daemon() function and the setsid executable. They
both call fork() and then setsid(). Do the console/rxvt process stick after calling ssh -f
because file descriptors are left open? Can you suggest a strategy to deal with this?
I'm not running ssh as a daemon. What I do in order to ssh to another
computer from any other shell is to keep one shell open all the time
running the agent. This is accomplished via the startssh function. In
the function I alias exit to call the stopssh function assuming of
course that this shell is the last to close. My rxvt closes just fine
this way. You only want to startssh one time. The alias ssh then
sources in the current agent information and calls the real ssh.
startssh()
{
KSAGENT="`type ssh-agent 2>/dev/null|sed 's/.* is //'`"
if [ -n "$KSAGENT" ]; then
ssh-agent |sed '/echo Agent pid/d' > $HOME/.ssh/current_agent
source $HOME/.ssh/current_agent
ssh-add
PROMPT_COMMAND='echo -n -e "\033]0;SSH-AGENT Started! $PWD\007"'
alias exit='stopssh;exit'
fi
}
stopssh()
{
eval `ssh-agent -k`
}
alias ssh="source $HOME/.ssh/current_agent;ssh"
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/