Do not let cron fail on errors around prctl
This commit is contained in:
parent
bd4d3b4519
commit
7853eaa1ca
|
@ -84,8 +84,15 @@ def spawn_cron(create_publisher):
|
|||
pub = create_publisher()
|
||||
# set process name, this only works on Linux, 15 == PR_SET_NAME
|
||||
if dl:
|
||||
libc = dl.open('/lib/libc.so.6')
|
||||
libc.call('prctl', 15, os.path.basename(sys.argv[0]) + ' [cron]\0', 0, 0, 0)
|
||||
try:
|
||||
libc = dl.open('/lib/libc.so.6')
|
||||
except dl.error:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
libc.call('prctl', 15, os.path.basename(sys.argv[0]) + ' [cron]\0', 0, 0, 0)
|
||||
except ValueError: # missing symbol
|
||||
pass
|
||||
signal.signal(signal.SIGTERM, stop_cron_process)
|
||||
cron(pub)
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Reference in New Issue