Browse Source

Implement PR #202

master
Michael Schloh von Bennewitz 22 years ago committed by Ralf S. Engelschall
parent
commit
bf5a5ec616
  1. 2
      nsd/fsl.nsd
  2. 21
      nsd/nsd.spec
  3. 5
      nsd/rc.nsd

2
nsd/fsl.nsd

@ -9,7 +9,7 @@ ident (nsd)/.+ q{
-> { -> {
debug: file( debug: file(
path="@l_prefix@/var/nsd/nsd.log", path="@l_prefix@/var/nsd/nsd.log",
perm=0644 perm=0644, jitter=1, monitor=3600
) )
} }
}; };

21
nsd/nsd.spec

@ -37,7 +37,7 @@ Distribution: OpenPKG [EVAL]
Group: DNS Group: DNS
License: GPL License: GPL
Version: 1.2.2 Version: 1.2.2
Release: 20030728 Release: 20031111
# package option # package option
%option with_fsl yes %option with_fsl yes
@ -56,8 +56,8 @@ BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030718, make BuildPreReq: OpenPKG, openpkg >= 20030718, make
PreReq: OpenPKG, openpkg >= 20030718 PreReq: OpenPKG, openpkg >= 20030718
%if "%{with_fsl}" == "yes" %if "%{with_fsl}" == "yes"
BuildPreReq: fsl >= 1.2.0 BuildPreReq: fsl >= 1.3.0
PreReq: fsl >= 1.2.0 PreReq: fsl >= 1.3.0
%endif %endif
AutoReq: no AutoReq: no
AutoReqProv: no AutoReqProv: no
@ -159,6 +159,19 @@ AutoReqProv: no
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
# update database # update database in every case
$RPM_INSTALL_PREFIX/sbin/nsdc rebuild $RPM_INSTALL_PREFIX/sbin/nsdc rebuild
# after upgrade, restart service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} nsd status 2>/dev/null`
[ ".$nsd_active" = .yes ] && %{l_rc} nsd restart
exit 0
%preun
# before erase, stop service and remove log files
[ $1 -eq 0 ] || exit 0
%{l_rc} nsd stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/nsd/*.log* >/dev/null 2>&1 || true
exit 0

5
nsd/rc.nsd

@ -21,18 +21,23 @@
%start -p 100 -u @l_susr@ %start -p 100 -u @l_susr@
rcService nsd enable yes || exit 0 rcService nsd enable yes || exit 0
rcService nsd active yes && exit 0
@l_prefix@/sbin/nsdc start @l_prefix@/sbin/nsdc start
%stop -p 100 -u @l_susr@ %stop -p 100 -u @l_susr@
rcService nsd enable yes || exit 0 rcService nsd enable yes || exit 0
rcService nsd active no && exit 0
@l_prefix@/sbin/nsdc stop @l_prefix@/sbin/nsdc stop
%reload -p 100 -u @l_susr@ %reload -p 100 -u @l_susr@
rcService nsd enable yes || exit 0 rcService nsd enable yes || exit 0
rcService nsd active no && exit 0
@l_prefix@/sbin/nsdc reload @l_prefix@/sbin/nsdc reload
%daily -u @l_rusr@ %daily -u @l_rusr@
rcService nsd enable yes || exit 0 rcService nsd enable yes || exit 0
# rotate logfile
shtool rotate -f \ shtool rotate -f \
-n ${nsd_log_numfiles} -s ${nsd_log_minsize} -d \ -n ${nsd_log_numfiles} -s ${nsd_log_minsize} -d \
-z ${nsd_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ -z ${nsd_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \

Loading…
Cancel
Save