File: needs_kill.py

package info (click to toggle)
pexpect 4.9-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,184 kB
  • sloc: python: 10,774; makefile: 138; sh: 73; ansic: 69
file content (13 lines) | stat: -rwxr-xr-x 352 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
"""This script can only be killed by SIGKILL."""
import signal, time

# Ignore interrupt, hangup and continue signals - only SIGKILL will work
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGHUP, signal.SIG_IGN)
signal.signal(signal.SIGCONT, signal.SIG_IGN)

print('READY')
while True:
    time.sleep(10)