Browse Source

Merge branch 'safe_stop' of lcmstaff/xfreerdpctl into master

Merging with master
lcmgit 1 year ago
parent
commit
eb8805575d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      xfreerdpctl

+ 7 - 1
xfreerdpctl

@@ -94,7 +94,13 @@ class Host(Thread):
     def xstop(self):
         if self.up:
             if self.running:
-                stopcmd = "pkill xfreerdp"
+                # Try to kill sending SIGTERM, wait, check if running and if so issue SIGKILL.
+                # (Do this asynchronously, on the remote node)
+                stopcmd = '''PCMDL="/usr/bin/xfreerdp /cert-ignore /f /v:tolab.fisica.unimi.it"
+                             pkill -xf "$PCMDL"
+                             sleep 5
+                             pgrep -xf "$PCMDL" && \
+                             pkill -9 -xf "$PCMDL"'''
                 self.sshcommand(stopcmd)
                 print 'xfreerdp stopped on ' + self.hostname
             else: