Forwarding SIGINT to child processes

3 posts / 0 new
Last post
itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Forwarding SIGINT to child processes

I am trying to replace RSH based automation with SSH. (How) Does the SSH protocol support forwarding of signals like SIGINT to child processes. Currently ^C is killing the local ssh client and leaving the still-running process bereft of a reader.

Marc

itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Re: Forwarding SIGINT to child processes

From ssh documentation:

Escape Characters
When a pseudo-terminal has been requested, ssh supports a number of func-
tions through the use of an escape character.

A single tilde character can be sent as ~~ or by following the tilde by a
character other than those described below. The escape character must
always follow a newline to be interpreted as special. The escape charac-
ter can be changed in configuration files using the EscapeChar configura-
tion directive or on the command line by the -e option.

The supported escapes (assuming the default `~') are:

~. Disconnect.

~^Z Background ssh.

~# List forwarded connections.

~& Background ssh at logout when waiting for forwarded connection /
X11 sessions to terminate.

~? Display a list of escape characters.

~B Send a BREAK to the remote system (only useful for SSH protocol
version 2 and if the peer supports it).

~C Open command line. Currently this allows the addition of port
forwardings using the -L and -R options (see below). It also al-
lows the cancellation of existing remote port-forwardings using
-KR hostport. Basic help is available, using the -h option.

~R Request rekeying of the connection (only useful for SSH protocol
version 2 and if the peer supports it).

itefix
Offline
Last seen: 1 week 6 days ago
Joined: 01.05.2008 - 21:33
Re: Forwarding SIGINT to child processes

I need to do this automatically though. Given the pid of an ssh, how do I terminate the remote process it is attached to. RSH would forward a SIGINT, allowing the remote process to catch it and shutdown gracefully. In this situation ssh simply exits without stopping the remote process (it will then run forever!)
Marc

Release announcements