Skip to content

Commit 1db2de8

Browse files
committed
disable ctrl+c to prevent breaking pipe
1 parent 9611a82 commit 1db2de8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ or placed in a file `~/.callhostrc` (automatically detected and sourced by `call
139139
The symptom of this will be that subsequent host commands hang, and pressing ctrl+C will give the error message "Interrupted system call".
140140
It is necessary to exit and reenter the container (in order to create a new pipe) if this occurs.
141141
To avoid this, chain multiple commands using logical operators (`&&` or `||`), or surround all the commands in `()` (thereby running them in a subshell).
142-
* Stopping a command in progress with ctrl+C will also break the pipe (as described in the previous item).
142+
* Stopping a command in progress with ctrl+C is disabled (to avoid breaking the pipe as described in the previous item).
143+
* Suspending a command with ctrl+Z is not supported and may break the session.
143144
144145
## `bind_condor.sh`
145146

call_host.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# check for configuration
55
CALL_HOST_CONFIG=~/.callhostrc
66
if [ -f "$CALL_HOST_CONFIG" ]; then
7-
# shellcheck source=/dev/null
7+
# shellcheck source=/dev/null
88
source "$CALL_HOST_CONFIG"
99
fi
1010

@@ -89,6 +89,8 @@ export -f startpipe
8989

9090
# sends function to host, then listens for output, and provides exit code from function
9191
call_host(){
92+
# disable ctrl+c to prevent "Interrupted system call"
93+
trap "" SIGINT
9294
if [ "${FUNCNAME[0]}" = "call_host" ]; then
9395
FUNCTMP=
9496
else

0 commit comments

Comments
 (0)