diff --git a/src/DEBIAN_postinst.in b/src/DEBIAN_postinst.in index 0902c4097a..37d6e90057 100755 --- a/src/DEBIAN_postinst.in +++ b/src/DEBIAN_postinst.in @@ -1,7 +1,5 @@ #!/bin/bash -set -e - # This will return 0 if an id is created and non-zero if # it already exists # https://www.debian.org/doc/debian-policy/ch-opersys.html#users-and-groups diff --git a/src/DEBIAN_prerm.in b/src/DEBIAN_prerm.in index 50b8fdc0e3..ffbbab79d0 100644 --- a/src/DEBIAN_prerm.in +++ b/src/DEBIAN_prerm.in @@ -1,7 +1,5 @@ #!/bin/bash -set -e - stop_rdc() { if [ -d /run/systemd/system ]; then #stop RDC if running @@ -11,8 +9,9 @@ stop_rdc() { } rm_rdc_service() { - if [ -e /run/systemd/system ]; then - unlink /lib/systemd/system/rdc.service + local LINK=/lib/systemd/system/rdc.service + if [ -L $LINK ]; then + unlink $LINK fi return 0 } diff --git a/src/RPM_postun.in b/src/RPM_postun.in index c6a0982332..601c346dfe 100755 --- a/src/RPM_postun.in +++ b/src/RPM_postun.in @@ -9,8 +9,9 @@ stop_rdc() { } rm_rdc_service() { - if [ -e /run/systemd/system ]; then - unlink @DISTRO_ROOT@/rdc.service + local LINK=@DISTRO_ROOT@/rdc.service + if [ -L $LINK ]; then + unlink $LINK fi return 0 }