You are not logged in.

#1 2009-04-04 08:13:26

fijam
Member
Registered: 2009-02-03
Posts: 244
Website

Catching a SIGTERM in Python

I am writing a kind of daemon and I would like to remove a .pid file when the process is exited or killed. I noticed that atexit.register does not work if the application receives SIGTERM. What is the proper and elegant way to handle it?

Thanks in advance

Offline

#2 2009-04-04 11:00:41

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Catching a SIGTERM in Python

Catching the sigterm and exit cleanly should work just fine.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB