Permalink
Browse files

use pidlockfile to create a pidfile

  • Loading branch information...
1 parent 25f3822 commit 24b4501d5edb3c7dd9e486055e799bb3ebdcf3fa @evgeni committed Jun 23, 2011
Showing with 6 additions and 1 deletion.
  1. +5 −1 aacraidd
  2. +1 −0 aacraidd.conf
View
@@ -3,6 +3,7 @@
from __future__ import with_statement
import daemon
+import daemon.pidlockfile
import aacraid
import signal
import os
@@ -58,7 +59,8 @@ mail_from = config.get('aacraidd', 'mail_from')
mail_to = config.get('aacraidd', 'mail_to')
log_file = config.get('aacraidd', 'log_file')
-
+pid_file = config.get('aacraidd', 'pid_file')
+
sleeptime = config.getint('aacraidd', 'sleeptime')
running = True
@@ -136,6 +138,8 @@ else:
detach_process=True,
files_preserve = [log]
)
+ pid = daemon.pidlockfile.PIDLockFile(pid_file)
+ context.pidfile = pid
context.signal_map = {
signal.SIGTERM: aacraidd_stop,
View
@@ -10,6 +10,7 @@ mail_from = raid@example.com
mail_to = root@example.com
log_file = aacraidd.log
+pid_file = aacraidd.pid
sleeptime = 300

0 comments on commit 24b4501

Please sign in to comment.