2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
8 if [ "%{name}" != "%\{name\}" ]; then
9 # Red Hat ("%{...}" is interpolated at package build time)
14 script="$(basename "${0}")"
15 pkg="${script%.prerm}"
20 case "${pkgtype}-${1}" in
22 if [ -e /run/systemd/system ]; then
23 systemctl stop "${pkg}" || true
24 systemctl disable "${pkg}" || true
26 if [ -e "${prefix}/share/doc/${pkg}/${pkg}.service" ]; then
27 # Unit files from Python packages get installed by
28 # postinst so we have to remove them explicitly here.
29 rm "/lib/systemd/system/${pkg}/${pkg}.service" || true