[Fedora-packaging] Running scriptlets only in certain situations

Chuck R. Anderson cra at WPI.EDU
Tue Mar 15 23:08:06 UTC 2005


On http://fedoraproject.org/wiki/PackagingGuidelines under "Running 
scriptlets only in certain situations" it gives an example:

This means that for example a package that installs an init script 
with the chkconfig command should uninstall it only on erase and not 
upgrade with the following snippet:

%postun
if [ $1 -eq 0 ]; then
    /sbin/chkconfig --del %{name}
fi


However, that example is incorrect.  By the time %postun is run, the
/etc/init.d/%{name} file is already gone.  This needs to be run
instead in %preun.




More information about the Fedora-packaging mailing list