=== modified file 'TODO'
--- TODO 2010-09-25 19:55:17 +0000
+++ TODO 2010-09-25 20:09:10 +0000
@@ -4,8 +4,6 @@
* Release critical
** mandos
-*** Do not write PID file if --debug is passed?
- Do other programs do this?
** Update copyright year to add 2010
** mandos.xml
*** Document the approval concept
=== modified file 'mandos'
--- mandos 2010-09-25 19:55:17 +0000
+++ mandos 2010-09-25 20:09:10 +0000
@@ -1763,11 +1763,12 @@
gnutls_priority=
server_settings[u"priority"],
use_dbus=use_dbus)
- pidfilename = u"/var/run/mandos.pid"
- try:
- pidfile = open(pidfilename, u"w")
- except IOError:
- logger.error(u"Could not open file %r", pidfilename)
+ if not debug:
+ pidfilename = u"/var/run/mandos.pid"
+ try:
+ pidfile = open(pidfilename, u"w")
+ except IOError:
+ logger.error(u"Could not open file %r", pidfilename)
try:
uid = pwd.getpwnam(u"_mandos").pw_uid
@@ -1875,21 +1876,22 @@
if not tcp_server.clients:
logger.warning(u"No clients defined")
- try:
- with pidfile:
- pid = os.getpid()
- pidfile.write(str(pid) + "\n")
- del pidfile
- except IOError:
- logger.error(u"Could not write to file %r with PID %d",
- pidfilename, pid)
- except NameError:
- # "pidfile" was never created
- pass
- del pidfilename
-
if not debug:
+ try:
+ with pidfile:
+ pid = os.getpid()
+ pidfile.write(str(pid) + "\n")
+ del pidfile
+ except IOError:
+ logger.error(u"Could not write to file %r with PID %d",
+ pidfilename, pid)
+ except NameError:
+ # "pidfile" was never created
+ pass
+ del pidfilename
+
signal.signal(signal.SIGINT, signal.SIG_IGN)
+
signal.signal(signal.SIGHUP, lambda signum, frame: sys.exit())
signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit())
=== modified file 'mandos.xml'
--- mandos.xml 2010-09-12 03:00:40 +0000
+++ mandos.xml 2010-09-25 20:09:10 +0000
@@ -2,7 +2,7 @@
-
+
%common;
]>
@@ -418,8 +418,8 @@
/var/run/mandos.pid
- The file containing the process id of
- &COMMANDNAME;.
+ The file containing the process id of the
+ &COMMANDNAME; process started last.