New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to kill ssh-agent not working #863

Closed
cheuer opened this Issue Sep 14, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@cheuer

cheuer commented Sep 14, 2016

Versions

ConEmu build: 160913 x64
OS version: Windows 10 x64 version 1607
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): GNU bash, version 4.3.42(4)-release (x86_64-unknown-cygwin)

Problem description

New option introduced in 160913 to kill ssh-agent processes when closing conemu doesn't seem to have any effect; conemu kills all ssh-agent processes no matter what.

Steps to reproduce

  1. Ensure "Kill ssh-agent with ConEmu" is disabled in Settings > Features is unchecked
  2. Start ssh-agent process
  3. Close conemu

Actual results

Started ssh-agent process is killed

Expected results

ssh-agent should continue running

Additional files

Settings and logfiles: https://www.dropbox.com/s/bwcn4zlc8fnr6er/ConEmuLogs_issue301.zip?dl=0

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Sep 14, 2016

Owner

Well, I'll fix it.
But why do you want to leave ssh-agent running after ConEmu exit?

Owner

Maximus5 commented Sep 14, 2016

Well, I'll fix it.
But why do you want to leave ssh-agent running after ConEmu exit?

@cheuer

This comment has been minimized.

Show comment
Hide comment
@cheuer

cheuer Sep 14, 2016

cheuer commented Sep 14, 2016

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Sep 14, 2016

Owner

Than, where do you store and initialize SSH_*** environment variables?

Owner

Maximus5 commented Sep 14, 2016

Than, where do you store and initialize SSH_*** environment variables?

@cheuer

This comment has been minimized.

Show comment
Hide comment
@cheuer

cheuer Sep 15, 2016

I have the following in my .bashrc file. It writes the output of ssh-agent to ~/.ssh-agent and sources that if ssh-add fails on subsequent calls.

alias scp='__ssh_agent && scp'
alias ssh='__ssh_agent && ssh'

function __ssh_agent() {
    # If no SSH agent is already running, start one now. Re-use sockets so we never
    # have to start more than one session.

    ssh-add -l >/dev/null 2>&1
    result=$?
    if [ $result = 2 ]; then
        # read ssh-agent config from file and retry
        [ -r ~/.ssh-agent ] && source ~/.ssh-agent >/dev/null
        ssh-add -l >/dev/null 2>&1
        result=$?
        if [ $result = 2 ]; then
            ssh-agent > ~/.ssh-agent
            source ~/.ssh-agent >/dev/null
            ssh-add
        fi
    fi
    if [ $result = 1 ]; then
        ssh-add
    fi
}

cheuer commented Sep 15, 2016

I have the following in my .bashrc file. It writes the output of ssh-agent to ~/.ssh-agent and sources that if ssh-add fails on subsequent calls.

alias scp='__ssh_agent && scp'
alias ssh='__ssh_agent && ssh'

function __ssh_agent() {
    # If no SSH agent is already running, start one now. Re-use sockets so we never
    # have to start more than one session.

    ssh-add -l >/dev/null 2>&1
    result=$?
    if [ $result = 2 ]; then
        # read ssh-agent config from file and retry
        [ -r ~/.ssh-agent ] && source ~/.ssh-agent >/dev/null
        ssh-add -l >/dev/null 2>&1
        result=$?
        if [ $result = 2 ]; then
            ssh-agent > ~/.ssh-agent
            source ~/.ssh-agent >/dev/null
            ssh-add
        fi
    fi
    if [ $result = 1 ]; then
        ssh-add
    fi
}
@cheuer

This comment has been minimized.

Show comment
Hide comment
@cheuer

cheuer Sep 15, 2016

Updated to 160914 this morning and can confirm the option works now. Thanks!

cheuer commented Sep 15, 2016

Updated to 160914 this morning and can confirm the option works now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment