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)
12 prefix="${RPM_INSTALL_PREFIX}"
15 script="$(basename "${0}")"
16 pkg="${script%.prerm}"
21 case "${pkgtype}-${1}" in
23 if [ -e /run/systemd/system ]; then
24 systemctl stop "${pkg}" || true
25 systemctl disable "${pkg}" || true
27 if [ -e "${prefix}/share/doc/${pkg}/${pkg}.service" ]; then
28 # Unit files from Python packages get installed by
29 # postinst so we have to remove them explicitly here.
30 rm "/lib/systemd/system/${pkg}/${pkg}.service" || true