Support proper sigterm exiting
This commit is contained in:
parent
9d4f773b94
commit
261d9394db
4
pvcd.py
4
pvcd.py
|
@ -24,6 +24,7 @@ import kazoo.client
|
|||
import libvirt
|
||||
import sys
|
||||
import os
|
||||
import signal
|
||||
import socket
|
||||
import psutil
|
||||
import subprocess
|
||||
|
@ -120,6 +121,9 @@ def cleanup():
|
|||
zk.close()
|
||||
update_timer.shutdown()
|
||||
|
||||
# Handle SIGTERM gracefully
|
||||
signal.signal(signal.SIGTERM, cleanup)
|
||||
|
||||
# Gather useful data about our host for staticdata
|
||||
# Static data format: 'cpu_count', 'arch', 'os', 'kernel'
|
||||
staticdata = []
|
||||
|
|
Loading…
Reference in New Issue