Fix use of scriplets.

1. chkconfig --add is always unconditional.
2. condrestart goes in %postun, not %post (fixes script errors in the
    installer)
http://fedoraproject.org/wiki/ScriptletSnippets for more information.
This commit is contained in:
Bill Nottingham 2006-03-08 20:56:44 +00:00
parent 4d83a353c3
commit 08986bc647

View File

@ -4,7 +4,7 @@
%endif %endif
Name: avahi Name: avahi
Version: 0.6.9 Version: 0.6.9
Release: 1 Release: 2
Summary: Local network service discovery Summary: Local network service discovery
Group: System Environment/Base Group: System Environment/Base
License: LGPL License: LGPL
@ -198,35 +198,22 @@ rm -rf $RPM_BUILD_ROOT
%post %post
/sbin/ldconfig /sbin/ldconfig
/sbin/chkconfig --add avahi-daemon >/dev/null 2>&1
/sbin/chkconfig --add avahi-dnsconfd >/dev/null 2>&1
if [ "$1" -eq 1 ]; then if [ "$1" -eq 1 ]; then
if ! /sbin/chkconfig --list avahi-daemon >/dev/null 2>&1 ; then
# if user has not configured avahi service at all
/sbin/chkconfig --add avahi-daemon >/dev/null 2>&1
fi;
if ! /sbin/chkconfig --list avahi-dnsconfd >/dev/null 2>&1 ; then
# avahi-dnsconfd NOT run by default in any runlevel; add it
# so system-config-services can see it
/sbin/chkconfig --add avahi-dnsconfd >/dev/null 2>&1
fi;
# We should realy make dbus reload the system.d config here. Dunno how though. # We should realy make dbus reload the system.d config here. Dunno how though.
# kill -HUP `cat /var/run/messagebus.pid` ? # kill -HUP `cat /var/run/messagebus.pid` ?
if [ -s /etc/localtime ]; then if [ -s /etc/localtime ]; then
cp -fp /etc/localtime /etc/avahi/etc/localtime || :; cp -fp /etc/localtime /etc/avahi/etc/localtime || :;
fi; fi;
elif [ "$1" -gt 1 ]; then fi
if ! /sbin/chkconfig --list avahi-daemon >/dev/null 2>&1 ; then
# if user has not configured avahi service at all %postun
# reset initscript run order: /sbin/ldconfig
LC_ALL=C /sbin/chkconfig --levels=0123456 avahi-daemon reset >/dev/null 2>&1 if [ "$1" -ge "1" ]; then
fi;
# pre 0.5.2-3, avahi-daemon initscript had 'chkconfig: 345 34 66',
# so it got started AFTER messagebus ( 97 ) and was unable to start.
# It now has 'chkconfig: 345 98 02'.
/sbin/service avahi-daemon condrestart >/dev/null 2>&1 /sbin/service avahi-daemon condrestart >/dev/null 2>&1
/sbin/service avahi-dnsconfd condrestart >/dev/null 2>&1 /sbin/service avahi-dnsconfd condrestart >/dev/null 2>&1
fi; fi
%postun -p /sbin/ldconfig
%preun %preun
if [ "$1" -eq 0 ]; then if [ "$1" -eq 0 ]; then