debian/package-helper: mount --bind systemd notify socket into chroot (Closes: #867187)
Signed-off-by: Simon Deziel <simon@sdeziel.info>
Simon Deziel
3 years ago
59 | 59 |
rm -rf $CHROOT_DIR/$UNBOUND_BASE_DIR && mkdir -p $CHROOT_DIR/$UNBOUND_BASE_DIR
|
60 | 60 |
cd /
|
61 | 61 |
tar -cf - $(echo $UNBOUND_BASE_DIR | sed 's/^\///') | (cd $CHROOT_DIR && tar -xf -)
|
|
62 |
if [ -S "/run/systemd/notify" ]; then
|
|
63 |
mkdir -p "$CHROOT_DIR/run/systemd"
|
|
64 |
touch "$CHROOT_DIR/run/systemd/notify"
|
|
65 |
mount --bind "/run/systemd/notify" "$CHROOT_DIR/run/systemd/notify"
|
|
66 |
fi
|
|
67 |
fi
|
|
68 |
}
|
|
69 |
|
|
70 |
do_chroot_teardown() {
|
|
71 |
if [ -d "$CHROOT_DIR" ] && mountpoint -q "$CHROOT_DIR/run/systemd/notify"; then
|
|
72 |
umount "$CHROOT_DIR/run/systemd/notify"
|
62 | 73 |
fi
|
63 | 74 |
}
|
64 | 75 |
|
|
89 | 100 |
;;
|
90 | 101 |
|
91 | 102 |
chroot_setup)
|
|
103 |
do_chroot_teardown
|
92 | 104 |
do_chroot_setup
|
|
105 |
;;
|
|
106 |
|
|
107 |
chroot_teardown)
|
|
108 |
do_chroot_teardown
|
93 | 109 |
;;
|
94 | 110 |
|
95 | 111 |
root_trust_anchor_update)
|
|
97 | 113 |
;;
|
98 | 114 |
|
99 | 115 |
*)
|
100 | |
echo "Usage: $0 {resolvconf_start|resolvconf_stop|chroot_setup|root_trust_anchor_update}" >&2
|
|
116 |
echo "Usage: $0 {resolvconf_start|resolvconf_stop|chroot_setup|chroot_teardown|root_trust_anchor_update}" >&2
|
101 | 117 |
exit 1
|
102 | 118 |
;;
|
103 | 119 |
esac
|
43 | 43 |
log_daemon_msg "Stopping $DESC" "$NAME"
|
44 | 44 |
if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --retry 5; then
|
45 | 45 |
$HELPER resolvconf_stop
|
|
46 |
$HELPER chroot_teardown
|
46 | 47 |
log_end_msg 0
|
47 | 48 |
else
|
48 | 49 |
log_end_msg 1
|
11 | 11 |
ExecStartPre=-/usr/lib/unbound/package-helper chroot_setup
|
12 | 12 |
ExecStartPre=-/usr/lib/unbound/package-helper root_trust_anchor_update
|
13 | 13 |
ExecStart=/usr/sbin/unbound -d -p $DAEMON_OPTS
|
|
14 |
ExecStopPost=-/usr/lib/unbound/package-helper chroot_teardown
|
14 | 15 |
ExecReload=+/bin/kill -HUP $MAINPID
|
15 | 16 |
|
16 | 17 |
[Install]
|