issue with postun scripts when renaming munin package
Asked Answered
F

1

7

I have two issues that i would like to figure out a solution to:

I am renaming the munin 2.0 package and in the SPEC file for the RPM I have to obsolete the original munin packages.

When replacing an existing 1.x munin package as part of the postun scriptlets of munin-node it removes the munin user.

postuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ]; then
    /usr/sbin/userdel munin || logger -t munin/rpm "User \"munin\" could not be deleted."
#       /usr/sbin/groupdel munin || logger -t munin/rpm "Group \"munin\" could not be deleted."
fi

When I am replacing an existing munin 2.0 package the postun deletes the contents of the plugins directory.

postuninstall scriptlet (using /bin/sh):
if [ "$1" = "0" ]; then
   [ -d /etc/munin/plugins ] && \
find /etc/munin/plugins/ -maxdepth 1 -type l -print0 | \
   xargs -0 rm || :
fi

Since yum installs the new package and then runs the posts for the old package and $1 = 0 in both cases it will run the scripts after my rpms have been installed. Is there a way to get around this?

Fluorescence answered 4/4, 2013 at 17:23 Comment(0)
C
0

The only thing I can think of would be a hack where you copy out the contents in your %pre into another location, and then %trigger on the uninstall of the other package to put them back. Not the best form, but it might work. Also requires that you are installed before the uninstall.

Coupon answered 5/4, 2013 at 9:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.