Codebase list unbound / 33a9f50
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
3 changed file(s) with 19 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5959 rm -rf $CHROOT_DIR/$UNBOUND_BASE_DIR && mkdir -p $CHROOT_DIR/$UNBOUND_BASE_DIR
6060 cd /
6161 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"
6273 fi
6374 }
6475
89100 ;;
90101
91102 chroot_setup)
103 do_chroot_teardown
92104 do_chroot_setup
105 ;;
106
107 chroot_teardown)
108 do_chroot_teardown
93109 ;;
94110
95111 root_trust_anchor_update)
97113 ;;
98114
99115 *)
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
101117 exit 1
102118 ;;
103119 esac
4343 log_daemon_msg "Stopping $DESC" "$NAME"
4444 if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --retry 5; then
4545 $HELPER resolvconf_stop
46 $HELPER chroot_teardown
4647 log_end_msg 0
4748 else
4849 log_end_msg 1
1111 ExecStartPre=-/usr/lib/unbound/package-helper chroot_setup
1212 ExecStartPre=-/usr/lib/unbound/package-helper root_trust_anchor_update
1313 ExecStart=/usr/sbin/unbound -d -p $DAEMON_OPTS
14 ExecStopPost=-/usr/lib/unbound/package-helper chroot_teardown
1415 ExecReload=+/bin/kill -HUP $MAINPID
1516
1617 [Install]