sup icon indicating copy to clipboard operation
sup copied to clipboard

Can't close interactive bash session

Open bborysenko opened this issue 9 years ago • 5 comments

^C doesn't close interactive session

$ cat Supfile

---
version: 0.4

networks:
  production:
    hosts:
      - [email protected]:9022
      - [email protected]:9022

commands:
  bash:
    desc: Interactive Bash on all hosts
    stdin: true
    run: bash

$ sup production bash
id
[email protected]:9022 | [bborysenko@rz-ca2 ~]$ uid=2028(bborysenko) gid=2028(bborysenko) groups=2028(bborysenko),10(wheel),2300(sysadmin)
[email protected]:9022 | [bborysenko@rz-ca1 ~]$ uid=2028(bborysenko) gid=2028(bborysenko) groups=2028(bborysenko),10(wheel),2300(sysadmin)
^[email protected]:9022 | [bborysenko@rz-ca2 ~]$ ^C
[email protected]:9022 | [bborysenko@rz-ca1 ~]$ ^C

bborysenko avatar Aug 04 '16 13:08 bborysenko

exit works and ^C should work too. The remote shell must ignore the INT signal or something. Can you send me name/version of your remote shell?

VojtechVitek avatar Aug 04 '16 14:08 VojtechVitek

sup production bash <<< 'bash --version'
[email protected]:9022 | [bborysenko@rz-ca2 ~]$ GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
[email protected]:9022 | [bborysenko@rz-ca1 ~]$ GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

bborysenko avatar Aug 08 '16 09:08 bborysenko

I'm not 100% convinced what to do in this case.

If you run bash inside of bash, the same thing happens.. ^C doesn't exit the process. However, ^D (closing stdin) or typing exit does.

I guess I should solve the ^D first, which doesn't seem to work properly... and then reconsider if multiple ^C should force-exit the remote process even if it traps SIGINT.

VojtechVitek avatar Aug 09 '16 17:08 VojtechVitek

FWIW I also can't seem to close multiple interactive bash sessions via ^C (or ^D for that matter). Though exit does work. This is with standard bash (afaik) on CoreOS Container Linux distro:

GNU bash, version 4.3.48(1)-release (x86_64-cros-linux-gnu)

Not a big deal however–may poke at the issue a bit myself. Btw, really wish I had discovered sup sooner, it's making life as an SRE much nicer :)

PaulCapestany avatar Apr 05 '18 18:04 PaulCapestany

Bump. Same - can't close the session. And yes sup is an amazing product, I should be using it now used of ansible and fabric.

AlexMikhalev avatar Jul 27 '20 13:07 AlexMikhalev