/mandos/release

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

« back to all changes in this revision

Viewing changes to INSTALL

  • Committer: Teddy Hogeborn
  • Date: 2019-08-02 22:16:53 UTC
  • mto: This revision was merged to the branch mainline in revision 386.
  • Revision ID: teddy@recompile.se-20190802221653-ic1iko9hbefzwsk7
Fix bug in server Debian package: Fails to start on first install

There has been a very long-standing bug where installation of the
server (the "mandos" Debian package) would fail to start the server
properly right after installation.  It would work on manual (re)start
after installation, or after reboot, and even after package purge and
reinstall, it would then work the first time.  The problem, it turns
out, is when the new "_mandos" user (and corresponding group) is
created, the D-Bus server is not reloaded, and is therefore not aware
of that user, and does not recognize the user and group name in the
/etc/dbus-1/system.d/mandos.conf file.  The Mandos server, when it
tries to start and access the D-Bus, is then not permitted to connect
to its D-Bus bus name, and disables D-Bus use as a fallback measure;
i.e. the server works, but it is not controllable via D-Bus commands
(via mandos-ctl or mandos-monitor).  The next time the D-Bus daemon is
reloaded for any reason, the new user & group would become visible to
the D-Bus daemon and after that, any restart of the Mandos server
would succeed and it would bind to its D-Bus name properly, and
thereby be visible and controllable by mandos-ctl & mandos-monitor.
This was mostly invisible when using sysvinit, but systemd makes the
problem visible since the systemd service file for the Mandos server
is configured to not consider the Mandos server "started" until the
D-Bus name has been bound; this makes the starting of the service wait
for 90 seconds and then fail with a timeout error.

Fixing this should also make the Debian CI autopkgtest tests work.

* debian/mandos.postinst (configure): After creating (or renaming)
                                      user & group, reload D-Bus
                                      daemon (if present).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
  
5
5
** Operating System
6
6
   
7
 
   Debian 6.0 "squeeze" or Ubuntu 10.10 "Maverick Meerkat" (or later).
 
7
   Debian 8.0 "jessie" or Ubuntu 15.10 "Wily Werewolf" (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 2.4          http://www.gnutls.org/
42
 
      Note: GnuTLS 3 will only work with Python-GnuTLS 2
43
 
    + Avahi 0.6.16        http://www.avahi.org/
 
41
    + GnuTLS 3.3          https://www.gnutls.org/
 
42
      (but not 3.6.0 or later, until 3.6.6, which works)
 
43
    + Avahi 0.6.16        https://www.avahi.org/
44
44
    + Python 2.7          https://www.python.org/
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/
 
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/
49
48
    + Urwid 1.0.1         http://urwid.org/
50
49
      (Only needed by the "mandos-monitor" tool.)
51
50
    
54
53
    + ssh-keyscan from OpenSSH http://www.openssh.com/
55
54
    
56
55
    Package names:
57
 
    python-gnutls avahi-daemon python python-avahi python-dbus
58
 
    python-gobject python-urwid pkg-config fping ssh-client
 
56
    avahi-daemon python python-dbus python-gi python-urwid pkg-config
 
57
    fping ssh-client
59
58
    
60
59
*** Mandos Client
 
60
    + GNU C Library 2.17 https://gnu.org/software/libc/
 
61
    + GnuTLS 3.3        https://www.gnutls.org/
 
62
      (but not 3.6.0 or later, until 3.6.6 which works)
 
63
    + Avahi 0.6.16      https://www.avahi.org/
 
64
    + GnuPG 1.4.9       https://www.gnupg.org/
 
65
    + GPGME 1.1.6       https://www.gnupg.org/related_software/gpgme/
 
66
    + pkg-config https://www.freedesktop.org/wiki/Software/pkg-config/
 
67
    + libnl-route 3     https://www.infradead.org/~tgr/libnl/
 
68
    + GLib 2.40         http://www.gtk.org/
 
69
    
 
70
    One of:
61
71
    + initramfs-tools 0.85i
62
72
                        https://tracker.debian.org/pkg/initramfs-tools
63
 
    + GnuTLS 2.4        http://www.gnutls.org/
64
 
    + Avahi 0.6.16      http://www.avahi.org/
65
 
    + GnuPG 1.4.9       https://www.gnupg.org/
66
 
    + GPGME 1.1.6       https://www.gnupg.org/related_software/gpgme/
67
 
    + pkg-config  http://www.freedesktop.org/wiki/Software/pkg-config/
 
73
    + dracut 044+241
 
74
         http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
68
75
    
69
76
    Strongly recommended:
70
77
    + OpenSSH           http://www.openssh.com/
71
78
    
72
79
    Package names:
73
 
    initramfs-tools libgnutls-dev libavahi-core-dev gnupg
74
 
    libgpgme11-dev pkg-config ssh
 
80
    initramfs-tools dracut libgnutls-dev gnutls-bin libavahi-core-dev
 
81
    gnupg libgpgme11-dev pkg-config ssh libnl-route-3-dev
 
82
    libglib2.0-dev
75
83
 
76
84
* Installing the Mandos server
77
85
  
124
132
     
125
133
        # /usr/lib/mandos/plugins.d/mandos-client \
126
134
                --pubkey=/etc/keys/mandos/pubkey.txt \
127
 
                --seckey=/etc/keys/mandos/seckey.txt; echo
 
135
                --seckey=/etc/keys/mandos/seckey.txt \
 
136
                --tls-privkey=/etc/keys/mandos/tls-privkey.pem \
 
137
                --tls-pubkey=/etc/keys/mandos/tls-pubkey.pem; echo
128
138
     
129
139
     This command should retrieve the password from the server,
130
140
     decrypt it, and output it to standard output.