Browse Source

Complete for compliance with features described by ticket #202

master
Michael Schloh von Bennewitz 23 years ago committed by Ralf S. Engelschall
parent
commit
274d907642
  1. 32
      bind8/bind8.spec
  2. 15
      bind8/rc.bind8

32
bind8/bind8.spec

@ -33,7 +33,7 @@ Distribution: OpenPKG [PLUS]
Group: DNS Group: DNS
License: GPL License: GPL
Version: 8.4.1 Version: 8.4.1
Release: 20030723 Release: 20030814
# list of sources # list of sources
Source0: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-src.tar.gz Source0: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-src.tar.gz
@ -153,20 +153,24 @@ Conflicts: bind, powerdns
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%pre %pre
if [ $1 -gt 1 ]; then # before upgrade, save status and stop service
# stop daemon before any upgrade [ $1 -eq 2 ] || exit 0
ls >/dev/null 2>&1 $RPM_INSTALL_PREFIX/var/bind/ndc \ eval `%{l_rc} bind8 status 2>/dev/null | tee %{l_tmpfile}`
&& $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1 \ %{l_rc} bind8 stop 2>/dev/null
|| true exit 0
%post
if [ $1 -eq 2 ]; then
# after upgrade, restore status
eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
[ ".$bind8_active" = .yes ] && %{l_rc} bind8 start
fi fi
exit 0
%preun %preun
if [ $1 -eq 0 ]; then # before erase, stop service and remove log files
# stop daemon before removing package [ $1 -eq 0 ] || exit 0
ls >/dev/null 2>&1 $RPM_INSTALL_PREFIX/var/bind/ndc \ %{l_rc} bind8 stop 2>/dev/null
&& $RPM_INSTALL_PREFIX/sbin/ndc stop >/dev/null 2>&1 \ rm -f $RPM_INSTALL_PREFIX/var/bind/*.log.* >/dev/null 2>&1 || true
|| true exit 0
# remove dynamically generated files
rm -f $RPM_INSTALL_PREFIX/var/bind/*
fi

15
bind8/rc.bind8

@ -5,6 +5,8 @@
%config %config
bind8_enable="$openpkg_rc_def" bind8_enable="$openpkg_rc_def"
bind8_log_prolog="true"
bind8_log_epilog="true"
bind8_log_numfiles="5" bind8_log_numfiles="5"
bind8_log_minsize="512K" bind8_log_minsize="512K"
bind8_log_complevel="9" bind8_log_complevel="9"
@ -19,25 +21,32 @@
%start -p 100 -u @l_susr@ %start -p 100 -u @l_susr@
rcService bind8 enable yes || exit 0 rcService bind8 enable yes || exit 0
rcService bind8 active yes && exit 0
@l_prefix@/sbin/ndc start @l_prefix@/sbin/ndc start
%stop -p 100 -u @l_susr@ %stop -p 100 -u @l_susr@
rcService bind8 enable yes || exit 0 rcService bind8 enable yes || exit 0
rcService bind8 active no && exit 0
@l_prefix@/sbin/ndc stop @l_prefix@/sbin/ndc stop
%restart -p 100 -u @l_susr@ %restart -p 100 -u @l_susr@
rcService bind8 enable yes || exit 0 rcService bind8 enable yes || exit 0
rcService bind8 active no && exit 0
@l_prefix@/sbin/ndc restart @l_prefix@/sbin/ndc restart
%reload -p 100 -u @l_susr@ %reload -p 100 -u @l_susr@
rcService bind8 enable yes || exit 0 rcService bind8 enable yes || exit 0
rcService bind8 active no && exit 0
@l_prefix@/sbin/ndc reload @l_prefix@/sbin/ndc reload
%daily -u @l_susr@ %daily -u @l_susr@
rcService bind8 enable yes || exit 0 rcService bind8 enable yes || exit 0
# rotate logfile
shtool rotate -f \ shtool rotate -f \
-n ${bind8_log_numfiles} -s ${bind8_log_minsize} \ -n ${bind8_log_numfiles} -s ${bind8_log_minsize} -d \
-d -z ${bind8_log_complevel} -o @l_musr@ -o @l_mgrp@ -m 644 \ -z ${bind8_log_complevel} -o @l_susr@ -o @l_mgrp@ -m 644 \
-E '@l_prefix@/sbin/ndc restart | grep -v "new pid is"' \ -P "${bind8_log_prolog}" \
-E "${bind8_log_epilog} && rc bind8 restart" \
@l_prefix@/var/bind/named.log @l_prefix@/var/bind/named.log

Loading…
Cancel
Save