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

  • Committer: Teddy Hogeborn
  • Date: 2008-08-02 10:48:24 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080802104824-fx0miwp9o4g9r31e
* plugbasedclient.c (struct process): New fields "eof", "completed",
                                      and "status".
  (handle_sigchld): New function.
  (main): Initialize "dir" to NULL to only closedir() it if necessary.
          Move "process_list" to be a global variable to be accessible
          by "handle_sigchld".  Make "handle_sigchld" handle SIGCHLD.
          Remove redundant check for NULL "dir".  Free "filename" when
          no longer used.  Block SIGCHLD around fork()/exec().
          Restore normal signals in child.  Only loop while running
          processes exist.  Print process buffer when the process is
          done and it has emitted EOF, not when it only emits EOF.
          Remove processes from list which exit non-cleanly.  In
          cleaning up, closedir() if necessary.  Bug fix: set next
          pointer correctly when freeing process list.

* plugins.d/passprompt.c (main): Do not ignore SIGQUIT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# This script can be called in the following ways:
3
 
#
4
 
# After the package was removed:
5
 
#       <postrm> remove
6
 
#
7
 
# After the package was purged:
8
 
#       <postrm> purge
9
 
#
10
 
# After the package was upgraded:
11
 
#       <old-postrm> upgrade <new-version>
12
 
# if that fails:
13
 
#       <new-postrm> failed-upgrade <old-version>
14
 
#
15
 
#
16
 
# After all of the packages files have been replaced:
17
 
#       <postrm> disappear <overwriting-package> <version>
18
 
#
19
 
#
20
 
# If preinst fails during install:
21
 
#       <new-postrm> abort-install
22
 
#
23
 
# If preinst fails during upgrade of removed package:
24
 
#       <new-postrm> abort-install <old-version>
25
 
#
26
 
# If preinst fails during upgrade:
27
 
#       <new-postrm> abort-upgrade <old-version>
28
 
 
29
 
set -e
30
 
 
31
 
# Update the initial RAM file system image
32
 
update_initramfs()
33
 
{
34
 
    if command -v update-initramfs >/dev/null; then
35
 
        update-initramfs -k all -u 1>&2
36
 
    elif command -v dracut >/dev/null; then
37
 
        # Logic taken from dracut.postinst
38
 
        for kernel in /boot/vmlinu[xz]-*; do
39
 
            kversion="${kernel#/boot/vmlinu[xz]-}"
40
 
            if [ "$kversion" != "*" ]; then
41
 
                /etc/kernel/postinst.d/dracut "$kversion" 1>&2
42
 
            fi
43
 
        done
44
 
    fi
45
 
}
46
 
 
47
 
case "$1" in
48
 
    remove)
49
 
        update_initramfs
50
 
        ;;
51
 
 
52
 
    purge)
53
 
        shred --remove /etc/keys/mandos/seckey.txt \
54
 
            /etc/keys/mandos/tls-privkey.pem 2>/dev/null || :
55
 
        rm --force /etc/mandos/plugin-runner.conf \
56
 
            /etc/keys/mandos/pubkey.txt \
57
 
            /etc/keys/mandos/seckey.txt \
58
 
            /etc/keys/mandos/tls-privkey.pem \
59
 
            /etc/keys/mandos/tls-pubkey.pem \
60
 
            /etc/keys/mandos/dhparams.pem 2>/dev/null
61
 
        update_initramfs
62
 
        ;;
63
 
    upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
64
 
        ;;
65
 
 
66
 
    *)
67
 
        echo "$0 called with unknown argument '$1'" 1>&2
68
 
        exit 1
69
 
        ;;
70
 
esac
71
 
 
72
 
#DEBHELPER#
73
 
 
74
 
exit 0