# Need to run after Debian/030-default-lts-conf to make sure our versions
# is the one that is used.
case "$MODE" in
    finalization)
        echo "info: Setting up nbdquery in chroot"
        cp /usr/share/debian-edu-config/tools/nbdquery  $ROOT/usr/sbin/.

        # openbsd-inetd to allow nbdquery to run on LTSP clients
        chroot $ROOT /usr/sbin/update-rc.d -f openbsd-inetd remove
        chroot $ROOT /usr/sbin/update-rc.d    openbsd-inetd defaults 20

        # run the nbdquery on port 9211 on the LTSP clients
        chroot $ROOT /usr/sbin/update-inetd --group LTSP --add \
            '9211 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/nbdquery'
        ;;
esac
