X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fdaemon.py;h=06f7beeae9a36e33459f3207a25f6fb75715f8af;hb=cdb998d12265ec4e1f64c87cff22a8657e2a93ea;hp=1feb7e42927fa3aeff8998419086a6e9a5b9a7db;hpb=cf5fee72c57cf6b6f09b9caa78ab9e547f1d7542;p=mpd-sima.git diff --git a/sima/lib/daemon.py b/sima/lib/daemon.py index 1feb7e4..06f7bee 100644 --- a/sima/lib/daemon.py +++ b/sima/lib/daemon.py @@ -14,20 +14,20 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # MPD_sima is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with MPD_sima. If not, see . +# along with MPD_sima. If not, see . import atexit import os import sys import time -from signal import signal, SIGTERM +from signal import signal, SIGTERM, SIGHUP, SIGUSR1 class Daemon(object): @@ -124,10 +124,16 @@ class Daemon(object): """Declare signal handlers """ signal(SIGTERM, self.exit_handler) + signal(SIGHUP, self.hup_handler) + signal(SIGUSR1, self.hup_handler) def exit_handler(self, signum, frame): sys.exit(1) + def hup_handler(self, signum, frame): + """SIGHUP handler""" + pass + def delpid(self): """Remove PID file""" try: