/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 INSTALL

  • 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
  
5
5
** Operating System
6
6
   
7
 
   Debian 8.0 "jessie" or Ubuntu 15.10 "Wily Werewolf" (or later).
 
7
   Debian 6.0 "squeeze" or Ubuntu 10.10 "Maverick Meerkat" (or later).
8
8
   
9
9
   This is mostly for the support scripts which make sure that the
10
10
   client is installed and started in the initial RAM disk environment
38
38
    "man -l mandos.8".
39
39
    
40
40
*** Mandos Server
41
 
    + GnuTLS 3.3          https://www.gnutls.org/
42
 
      (but not 3.6.0 or later, until 3.6.6, which works)
 
41
    + GnuTLS 2.4          http://www.gnutls.org/
 
42
      Note: GnuTLS 3 will only work with Python-GnuTLS 2
43
43
    + Avahi 0.6.16        http://www.avahi.org/
44
44
    + Python 2.7          https://www.python.org/
45
 
    + dbus-python 0.82.4 https://dbus.freedesktop.org/doc/dbus-python/
46
 
    + PyGObject 3.7.1     https://wiki.gnome.org/Projects/PyGObject
47
 
    + pkg-config https://www.freedesktop.org/wiki/Software/pkg-config/
 
45
    + Python-GnuTLS 1.1.5 https://pypi.python.org/pypi/python-gnutls/
 
46
    + dbus-python 0.82.4  http://dbus.freedesktop.org/doc/dbus-python/
 
47
    + PyGObject 2.14.2    https://developer.gnome.org/pygobject/
 
48
    + pkg-config  http://www.freedesktop.org/wiki/Software/pkg-config/
48
49
    + Urwid 1.0.1         http://urwid.org/
49
50
      (Only needed by the "mandos-monitor" tool.)
50
51
    
53
54
    + ssh-keyscan from OpenSSH http://www.openssh.com/
54
55
    
55
56
    Package names:
56
 
    avahi-daemon python python-dbus python-gi python-urwid pkg-config
57
 
    fping ssh-client
 
57
    python-gnutls avahi-daemon python python-avahi python-dbus
 
58
    python-gobject python-urwid pkg-config fping ssh-client
58
59
    
59
60
*** Mandos Client
60
 
    + GNU C Library 2.16 https://gnu.org/software/libc/
61
61
    + initramfs-tools 0.85i
62
62
                        https://tracker.debian.org/pkg/initramfs-tools
63
 
    + GnuTLS 3.3        https://www.gnutls.org/
64
 
      (but not 3.6.0 or later, until 3.6.6 which works)
 
63
    + GnuTLS 2.4        http://www.gnutls.org/
65
64
    + Avahi 0.6.16      http://www.avahi.org/
66
65
    + GnuPG 1.4.9       https://www.gnupg.org/
67
66
    + GPGME 1.1.6       https://www.gnupg.org/related_software/gpgme/
68
 
    + pkg-config https://www.freedesktop.org/wiki/Software/pkg-config/
 
67
    + pkg-config  http://www.freedesktop.org/wiki/Software/pkg-config/
69
68
    
70
69
    Strongly recommended:
71
70
    + OpenSSH           http://www.openssh.com/
72
71
    
73
72
    Package names:
74
 
    initramfs-tools libgnutls-dev gnutls-bin libavahi-core-dev gnupg
 
73
    initramfs-tools libgnutls-dev libavahi-core-dev gnupg
75
74
    libgpgme11-dev pkg-config ssh
76
75
 
77
76
* Installing the Mandos server
125
124
     
126
125
        # /usr/lib/mandos/plugins.d/mandos-client \
127
126
                --pubkey=/etc/keys/mandos/pubkey.txt \
128
 
                --seckey=/etc/keys/mandos/seckey.txt \
129
 
                --tls-privkey=/etc/keys/mandos/tls-privkey.pem \
130
 
                --tls-pubkey=/etc/keys/mandos/tls-pubkey.pem; echo
 
127
                --seckey=/etc/keys/mandos/seckey.txt; echo
131
128
     
132
129
     This command should retrieve the password from the server,
133
130
     decrypt it, and output it to standard output.