File: stop-using-kill-9.py

package info (click to toggle)
px 3.6.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,172 kB
  • sloc: python: 6,445; sh: 205; makefile: 4
file content (16 lines) | stat: -rwxr-xr-x 303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3

import os
import time
import signal


def receiveSignal(signalNumber, _):
    print("Received signal " + str(signalNumber))


signal.signal(signal.SIGTERM, receiveSignal)

print('Waiting to be killed using "kill -9 ' + str(os.getpid()) + '"...')
while True:
    time.sleep(1234)