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?