/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 plugins.d/mandos-client.xml

  • Committer: Teddy Hogeborn
  • Date: 2015-05-23 20:18:34 UTC
  • mto: (237.7.304 trunk)
  • mto: This revision was merged to the branch mainline in revision 325.
  • 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:
2
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3
3
        "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4
4
<!ENTITY COMMANDNAME "mandos-client">
5
 
<!ENTITY TIMESTAMP "2017-02-23">
 
5
<!ENTITY TIMESTAMP "2015-03-08">
6
6
<!ENTITY % common SYSTEM "../common.ent">
7
7
%common;
8
8
]>
33
33
    <copyright>
34
34
      <year>2008</year>
35
35
      <year>2009</year>
36
 
      <year>2010</year>
37
 
      <year>2011</year>
38
36
      <year>2012</year>
39
37
      <year>2013</year>
40
38
      <year>2014</year>
41
 
      <year>2015</year>
42
 
      <year>2016</year>
43
 
      <year>2017</year>
44
39
      <holder>Teddy Hogeborn</holder>
45
40
      <holder>Björn Påhlsson</holder>
46
41
    </copyright>
103
98
      </arg>
104
99
      <sbr/>
105
100
      <arg>
106
 
        <option>--dh-params <replaceable>FILE</replaceable></option>
107
 
      </arg>
108
 
      <sbr/>
109
 
      <arg>
110
101
        <option>--delay <replaceable>SECONDS</replaceable></option>
111
102
      </arg>
112
103
      <sbr/>
321
312
          <para>
322
313
            Sets the number of bits to use for the prime number in the
323
314
            TLS Diffie-Hellman key exchange.  The default value is
324
 
            selected automatically based on the OpenPGP key.  Note
325
 
            that if the <option>--dh-params</option> option is used,
326
 
            the values from that file will be used instead.
327
 
          </para>
328
 
        </listitem>
329
 
      </varlistentry>
330
 
      
331
 
      <varlistentry>
332
 
        <term><option>--dh-params=<replaceable
333
 
        >FILE</replaceable></option></term>
334
 
        <listitem>
335
 
          <para>
336
 
            Specifies a PEM-encoded PKCS#3 file to read the parameters
337
 
            needed by the TLS Diffie-Hellman key exchange from.  If
338
 
            this option is not given, or if the file for some reason
339
 
            could not be used, the parameters will be generated on
340
 
            startup, which will take some time and processing power.
341
 
            Those using servers running under time, power or processor
342
 
            constraints may want to generate such a file in advance
343
 
            and use this option.
 
315
            selected automatically based on the OpenPGP key.
344
316
          </para>
345
317
        </listitem>
346
318
      </varlistentry>
473
445
  
474
446
  <refsect1 id="environment">
475
447
    <title>ENVIRONMENT</title>
476
 
    <variablelist>
477
 
      <varlistentry>
478
 
        <term><envar>MANDOSPLUGINHELPERDIR</envar></term>
479
 
        <listitem>
480
 
          <para>
481
 
            This environment variable will be assumed to contain the
482
 
            directory containing any helper executables.  The use and
483
 
            nature of these helper executables, if any, is
484
 
            purposefully not documented.
485
 
        </para>
486
 
        </listitem>
487
 
      </varlistentry>
488
 
    </variablelist>
489
448
    <para>
490
 
      This program does not use any other environment variables, not
491
 
      even the ones provided by <citerefentry><refentrytitle
 
449
      This program does not use any environment variables, not even
 
450
      the ones provided by <citerefentry><refentrytitle
492
451
      >cryptsetup</refentrytitle><manvolnum>8</manvolnum>
493
452
    </citerefentry>.
494
453
    </para>
694
653
    </variablelist>
695
654
  </refsect1>
696
655
  
697
 
  <refsect1 id="bugs">
698
 
    <title>BUGS</title>
699
 
    <xi:include href="../bugs.xml"/>
700
 
  </refsect1>
 
656
<!--   <refsect1 id="bugs"> -->
 
657
<!--     <title>BUGS</title> -->
 
658
<!--     <para> -->
 
659
<!--     </para> -->
 
660
<!--   </refsect1> -->
701
661
  
702
662
  <refsect1 id="example">
703
663
    <title>EXAMPLE</title>
843
803
      </varlistentry>
844
804
      <varlistentry>
845
805
        <term>
846
 
          <ulink url="https://www.gnutls.org/">GnuTLS</ulink>
 
806
          <ulink url="http://www.gnu.org/software/gnutls/"
 
807
          >GnuTLS</ulink>
847
808
        </term>
848
809
      <listitem>
849
810
        <para>
855
816
      </varlistentry>
856
817
      <varlistentry>
857
818
        <term>
858
 
          <ulink url="https://www.gnupg.org/related_software/gpgme/"
 
819
          <ulink url="http://www.gnupg.org/related_software/gpgme/"
859
820
                 >GPGME</ulink>
860
821
        </term>
861
822
        <listitem>
899
860
      </varlistentry>
900
861
      <varlistentry>
901
862
        <term>
902
 
          RFC 5246: <citetitle>The Transport Layer Security (TLS)
903
 
          Protocol Version 1.2</citetitle>
 
863
          RFC 4346: <citetitle>The Transport Layer Security (TLS)
 
864
          Protocol Version 1.1</citetitle>
904
865
        </term>
905
866
      <listitem>
906
867
        <para>
907
 
          TLS 1.2 is the protocol implemented by GnuTLS.
 
868
          TLS 1.1 is the protocol implemented by GnuTLS.
908
869
        </para>
909
870
      </listitem>
910
871
      </varlistentry>
921
882
      </varlistentry>
922
883
      <varlistentry>
923
884
        <term>
924
 
          RFC 6091: <citetitle>Using OpenPGP Keys for Transport Layer
 
885
          RFC 5081: <citetitle>Using OpenPGP Keys for Transport Layer
925
886
          Security</citetitle>
926
887
        </term>
927
888
      <listitem>