summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/process.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-02 13:08:02 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-02 14:52:53 +0200
commit302c7563efa301829d9b695e77dad0859e629885 (patch)
treea4064fd694cb63d1e0018a37a9d6cc2301cc9ed8 /src/osmo_gsm_tester/process.py
parenta9006dffd951f17e945f9aff42e66db7cae8087a (diff)
osmotrx: Make sure remote process stops after ssh session is closed
First of all, it was found that vty allocation must be forced (-t -t) during ssh session creation to make sure SIGHUP is forwarded when session is closed. Second, since osmo-trx ignores SIGHUP (osmo_init_ignore_signals()), we must add a wrapper script which converts received SIGHUP into a SIGINT to stop osmo-trx. Change-Id: Ic334a54b1a1827d74fe0b453ac32bb77b8616147
Diffstat (limited to 'src/osmo_gsm_tester/process.py')
-rw-r--r--src/osmo_gsm_tester/process.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 9db9241..534cdba 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -228,7 +228,10 @@ class RemoteProcess(Process):
cd = 'cd "%s"; ' % self.remote_cwd
else:
cd = ''
- self.popen_args = ['ssh', self.remote_user+'@'+self.remote_host,
+ # We need double -t to force tty and be able to forward signals to
+ # processes (SIGHUP) when we close ssh on the local side. As a result,
+ # stderr seems to be merged into stdout in ssh client.
+ self.popen_args = ['ssh', '-t', '-t', self.remote_user+'@'+self.remote_host,
'%s%s' % (cd,
' '.join(self.popen_args))]
self.dbg(self.popen_args, dir=self.run_dir, conf=self.popen_kwargs)