Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/emc/usr_intf/touchy/touchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,4 +905,13 @@ def trivkins(self):
else:
res = os.spawnvp(os.P_WAIT, "halcmd", ["halcmd", "-i", inifile, "-f", f])
if res: raise SystemExit(res)

# Exit cleanly on SIGTERM. Without this touchy ignores the signal
# (GLib/PyGObject absorbs it), so a caller has to escalate to SIGKILL.
# The handler defers the quit to the main loop, since GTK calls are not
# safe directly from a signal handler.
def _signal_quit(signum, frame):
GLib.idle_add(Gtk.main_quit)
signal.signal(signal.SIGTERM, _signal_quit)

Gtk.main()
Loading