diff --git a/dcron/dcron.spec b/dcron/dcron.spec index 0000cc382d..32676c5946 100644 --- a/dcron/dcron.spec +++ b/dcron/dcron.spec @@ -37,7 +37,7 @@ Distribution: OpenPKG [EVAL] Group: System License: GPL Version: %{V_major}.%{V_minor} -Release: 20030722 +Release: 20031020 # list of sources Source0: http://apollo.backplane.com/FreeSrc/dcron%{V_major}%{V_minor}.tgz @@ -53,9 +53,9 @@ AutoReq: no AutoReqProv: no %description - A multi-user cron written from scratch by the author, similar to vixie-cron - but with significant differences. Attention paid less to feature creep and - more to usability and reliability. + A multiuser cron written from scratch, dcron is follows concepts of + vixie-cron but has significant differences. Less attention is paid + to feature development in favor of usability and reliability. %prep %setup -q -n dcron @@ -96,3 +96,16 @@ AutoReqProv: no %clean rm -rf $RPM_BUILD_ROOT +%post + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} dcron status 2>/dev/null` + [ ".$dcron_active" = .yes ] && %{l_rc} dcron restart + exit 0 + +%preun + # before erase, stop service + [ $1 -eq 0 ] || exit 0 + %{l_rc} dcron stop 2>/dev/null + exit 0 + diff --git a/dcron/rc.dcron b/dcron/rc.dcron index b3f561a8f8..410e1e8380 100644 --- a/dcron/rc.dcron +++ b/dcron/rc.dcron @@ -23,10 +23,19 @@ %start -u @l_susr@ rcService dcron enable yes || exit 0 + rcService dcron active yes && exit 0 @l_prefix@/sbin/crond %stop -u @l_susr@ rcService dcron enable yes || exit 0 + rcService dcron active no && exit 0 dcron_signal TERM rm -f @l_prefix@/var/dcron/dcron.pid 2>/dev/null || true +%restart -u @l_susr@ + rcService dcron enable yes || exit 0 + rcService dcron active no && exit 0 + rc dcron stop + sleep 2 + rc dcron start +