/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos.conf

  • Committer: Teddy Hogeborn
  • Date: 2015-05-23 20:18:34 UTC
  • mto: This revision was merged to the branch mainline in revision 756.
  • Revision ID: teddy@recompile.se-20150523201834-e89ex4ito93yni8x
mandos: Use multiprocessing module to run checkers.

For a long time, the Mandos server has occasionally logged the message
"ERROR: Child process vanished".  This was never a fatal error, but it
has been annoying and slightly worrying, since a definite cause was
not found.  One potential cause could be the "multiprocessing" and
"subprocess" modules conflicting w.r.t. SIGCHLD.  To avoid this,
change the running of checkers from using subprocess.Popen
asynchronously to instead first create a multiprocessing.Process()
(which is asynchronous) calling a function, and have that function
then call subprocess.call() (which is synchronous).  In this way, the
only thing using any asynchronous subprocesses is the multiprocessing
module.

This makes it necessary to change one small thing in the D-Bus API,
since the subprocesses.call() function does not expose the raw wait(2)
status value.

DBUS-API (CheckerCompleted): Change the second value provided by this
                             D-Bus signal from the raw wait(2) status
                             to the actual terminating signal number.
mandos (subprocess_call_pipe): New function to be called by
                               multiprocessing.Process (starting a
                               separate process).
(Client.last_checker signal): New attribute for signal which
                              terminated last checker.  Like
                              last_checker_status, only not accessible
                              via D-Bus.
(Client.checker_callback): Take new "connection" argument and use it
                           to get returncode; set last_checker_signal.
                           Return False so gobject does not call this
                           callback again.
(Client.start_checker): Start checker using a multiprocessing.Process
                        instead of a subprocess.Popen.
(ClientDBus.checker_callback): Take new "connection" argument.        Call
                               Client.checker_callback early to have
                               it set last_checker_status and
                               last_checker_signal; use those.  Change
                               second value provided to D-Bus signal
                               CheckerCompleted to use
                               last_checker_signal if checker was
                               terminated by signal.
mandos-monitor: Update to reflect DBus API change.
(MandosClientWidget.checker_completed): Take "signal" instead of
                                        "condition" argument.  Use it
                                        accordingly.  Remove dead code
                                        (os.WCOREDUMP case).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# These are the default values for the server, uncomment and change
5
5
# them if needed.
6
6
 
7
 
 
8
7
# If "interface" is set, the server will only listen to a specific
9
8
# network interface.
10
9
;interface = 
11
10
 
12
 
 
13
11
# If "address" is set, the server will only listen to a specific
14
12
# address.  This must currently be an IPv6 address; an IPv4 address
15
13
# can be specified using the "::FFFF:192.0.2.3" syntax.  Also, if this
16
14
# is a link-local address, an interface should be set above.
17
15
;address =
18
16
 
19
 
 
20
17
# If "port" is set, the server to bind to that port. By default, the
21
18
# server will listen to an arbitrary port.
22
19
;port = 
23
20
 
24
 
 
25
21
# If "debug" is true, the server will run in the foreground and print
26
22
# a lot of debugging information.
27
23
;debug = False
28
24
 
29
 
 
30
25
# GnuTLS priority for the TLS handshake.  See gnutls_priority_init(3).
31
 
;priority = SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP
32
 
 
 
26
;priority = SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-RSA-SHA224:+SIGN-RSA-RMD160
33
27
 
34
28
# Zeroconf service name.  You need to change this if you for some
35
29
# reason want to run more than one server on the same *host*.
42
36
 
43
37
# Whether to use IPv6.  (Changing this is NOT recommended.)
44
38
;use_ipv6 = True
 
39
 
 
40
# Whether to restore saved state on startup
 
41
;restore = True
 
42
 
 
43
# The directory where state is saved
 
44
;statedir = /var/lib/mandos
 
45
 
 
46
# Whether to run in the foreground
 
47
;foreground = False
 
48
 
 
49
# File descriptor number to use for network socket
 
50
;socket = 
 
51
 
 
52
# Whether to use ZeroConf; if false, requires port or socket
 
53
;zeroconf = True