if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ]; then
    if [ -x "/usr/bin/svctl" ]; then
        # NOTE: unlike invoke-rc.d, this never consults /usr/sbin/policy-rc.d, so there's
        # no standard way for a caller (e.g. a config management run still in progress) to
        # suppress this start. A consumer that needs the unit to not come up on install can
        # still pre-empt it today by touching /usr/lib/s6-rc/masked/<unit> before this package
        # installs - svctl-enable (below) refuses to enable anything already masked there.
        # restart service if either it is enabled or running
        for unit in #UNITFILES#; do
            if svctl isenabled $unit >/dev/null 2>&1 || svctl isup $unit >/dev/null 2>&1; then
                svctl restart $unit || true
            fi
        done
    fi
fi
