/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 debian/mandos-client.postrm

  • Committer: Teddy Hogeborn
  • Date: 2019-07-30 17:03:57 UTC
  • mto: This revision was merged to the branch mainline in revision 384.
  • Revision ID: teddy@recompile.se-20190730170357-jte0piul5mq7j5pr
Server: Reap zombies created by multiprocessing.Process()

When creating checkers as multiprocessing.Process() objects, the
multiprocessing module also creates a parent process (for the
call_pipe() function) to call the actual checker process, but this
parent process is not reaped.  This is not a huge problem, since the
zombie is always reaped automatically the next time the multiprocess
starts a new process, but the zombies can be up to as many as there
have ever been simultaneous checker processes.  To fix this, the
process object must be join():ed when they report completion of the
child checker process.

* mandos (Client): Fix doc string to correctly state that
                   Client.checker is a multiprocess.Process() and not
                   a subprocess.Popen() object.
  (Client.checker_callback): After the returncode of the checker
                             process has been read, wait for the
                             self.checker Process object to finish by
                             calling join() on it.

Reported-by: Peter Palfrader <weasel@debian.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
 
1
#!/bin/sh
2
2
# This script can be called in the following ways:
3
3
#
4
4
# After the package was removed:
26
26
# If preinst fails during upgrade:
27
27
#       <new-postrm> abort-upgrade <old-version>
28
28
 
 
29
set -e
29
30
 
30
 
# Update the initramfs
 
31
# Update the initial RAM file system image
31
32
update_initramfs()
32
33
{
33
 
        if which update-initramfs >/dev/null 2>&1; then
34
 
                update-initramfs -u
35
 
        fi
 
34
    update-initramfs -u -k all || :
36
35
}
37
36
 
38
 
 
39
37
case "$1" in
40
38
    remove)
41
39
        update_initramfs
42
40
        ;;
43
41
 
44
42
    purge)
45
 
        shred --remove /etc/keys/mandos/seckey.txt || :
 
43
        shred --remove /etc/keys/mandos/seckey.txt 2>/dev/null || :
46
44
        rm --force /etc/mandos/plugin-runner.conf \
47
45
            /etc/keys/mandos/pubkey.txt \
48
 
            /etc/keys/mandos/seckey.txt
49
 
        rmdir /etc/keys/mandos /etc/mandos/plugins.d /etc/mandos || :
 
46
            /etc/keys/mandos/seckey.txt \
 
47
            /etc/keys/mandos/tls-privkey.pem \
 
48
            /etc/keys/mandos/tls-pubkey.pem \
 
49
            /etc/keys/mandos/dhparams.pem 2>/dev/null
 
50
        update_initramfs
50
51
        ;;
51
52
    upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
52
53
        ;;
53
54
 
54
55
    *)
55
 
        echo "$0 called with unknown argument \`$1'" 1>&2
 
56
        echo "$0 called with unknown argument '$1'" 1>&2
56
57
        exit 1
57
58
        ;;
58
59
esac