2 # postinst script for ganeti
6 # summary of how this script can be called:
7 # * <postinst> `configure' <most-recently-configured-version>
8 # * <old-postinst> `abort-upgrade' <new version>
9 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
11 # * <postinst> `abort-remove'
12 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
13 # <failed-install-package> <version> `removing'
14 # <conflicting-package> <version>
15 # for details, see http://www.debian.org/doc/debian-policy/ or
16 # the debian-policy package
23 # Remove stale PID files
24 # Ganeti versions prior to 2.8.0~rc4 leave Haskell daemon pidfiles
25 # behind. If these are root-owned, starting the daemons as unprivileged
28 # All daemons have been stopped during prerm, so it's safe to remove
30 for daemon in confd mond luxid; do
31 rm -f /var/run/ganeti/ganeti-${daemon}.pid
34 # Also remove luxid's socket
35 rm -f /var/run/ganeti/socket/ganeti-query
38 abort-upgrade|abort-remove|abort-deconfigure)
42 echo "postinst called with unknown argument \`$1'" >&2
47 # dh_installdeb will replace this with shell code automatically
48 # generated by other debhelper scripts.
52 # Fix jobqueue archive permissions
53 # This may take a while, so we only do this if necessary
54 find /var/lib/ganeti/queue/archive -mindepth 1 -maxdepth 1 \
55 -type d -not -user "@GNTMASTERUSER@" | while read dirname; do
56 /usr/lib/ganeti/ensure-dirs --full-run