if [ "$1" = "remove" ]; then
    if [ -x "/usr/bin/svctl" ]; then
        # stop and disable units since files are about to be removed
        svctl stop #UNITFILES# || true
        svctl disable #UNITFILES# || true
        if ! svctl update; then
            echo "dh-s6: WARNING 'svctl update' failed. The message above names" >&2
            echo "dh-s6: WARNING the services that did not reach the wanted state." >&2
            echo "dh-s6: WARNING The removal continues anyway: a hanging service must not" >&2
            echo "dh-s6: WARNING leave dpkg holding its lock and block every further" >&2
            echo "dh-s6: WARNING package operation (rt-2.tick1, 22.09.2026). The s6" >&2
            echo "dh-s6: WARNING database is NOT up to date then:" >&2
            echo "dh-s6: WARNING fix the cause and run 'svctl update' again." >&2
        fi
    fi
fi
