2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Only remove the systemd unit service file if we copied it manually.

If the service file was installed as part of the package it will
be removed automatically when the package is uninstalled.
This commit is contained in:
Todd C. Miller 2020-04-21 11:05:29 -06:00
parent 99129ba41f
commit d22800edd5

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright 2020 One Identity LLC. ALL RIGHTS RESERVED
pp_revision="20200416"
pp_revision="20200421"
# Copyright 2018 One Identity LLC. ALL RIGHTS RESERVED.
#
# Redistribution and use in source and binary forms, with or without
@ -8920,9 +8920,7 @@ pp_systemd_service_install_common () {
if test -x "$systemctl_cmd" && test -d "$systemd_system_conf_dir/$systemd_target_wants"; then
# If our service file still exists (upgrade) remove the link/file and systemctl
# will recreate it if/when we enable the $svc service.
if test -e "$systemd_system_conf_dir/$systemd_target_wants/$svc.service" ; then
rm -f "$systemd_system_conf_dir/$systemd_target_wants/$svc.service"
fi
# Copy the $svc.service file to the correct systemd_system_unit_dir location
if [ "x$systemd_service_dir" != "x$systemd_system_unit_dir" ]; then
@ -9030,7 +9028,7 @@ pp_systemd_service_remove_common () {
fi
# Remove the systemd unit service file
if test -e "$systemd_system_unit_dir/$svc.service"; then
if [ "x$systemd_service_dir" != "x$systemd_system_unit_dir" ]; then
rm -f "$systemd_system_unit_dir/$svc.service"
fi