diff --git a/at-3.1.10-opt_V.patch b/at-3.1.10-opt_V.patch new file mode 100644 index 0000000..f5f8250 --- /dev/null +++ b/at-3.1.10-opt_V.patch @@ -0,0 +1,28 @@ +--- at-3.1.10/configure.in.opt_v 2007-07-04 17:05:33.000000000 +0200 ++++ at-3.1.10/configure.in 2007-07-09 09:23:24.000000000 +0200 +@@ -5,7 +5,7 @@ + AC_CONFIG_HEADER(config.h) + AC_PREREQ(2.7) + +-VERSION="3.1.9" ++VERSION="3.1.10" + if test "X$CFLAGS" = "X"; then + CFLAGS="-O2 -g -Wall" + fi +--- at-3.1.10/at.c.opt_v 2007-07-04 17:05:33.000000000 +0200 ++++ at-3.1.10/at.c 2007-07-09 09:34:34.000000000 +0200 +@@ -966,9 +966,11 @@ + /* end of options eating + */ + +- if (disp_version) +- fprintf(stderr, "at version " VERSION "\n" +- "Bug reports to: rmurray@debian.org (Ryan Murray)\n"); ++ if (disp_version) { ++ fprintf(stderr, "at version " VERSION "\n"); ++ if (argc == 2) ++ exit(EXIT_SUCCESS); ++ } + + /* select our program + */ diff --git a/at.spec b/at.spec index 80f1689..2d8c119 100644 --- a/at.spec +++ b/at.spec @@ -6,13 +6,14 @@ Summary: Job spooling tools Name: at Version: 3.1.10 -Release: 13%{?dist} +Release: 14%{?dist} License: GPL Group: System Environment/Daemons URL: http://ftp.debian.org/debian/pool/main/a/at Source: http://ftp.debian.org/debian/pool/main/a/at/at_%{major_ver}.tar.gz Source1: test.pl Source2: atd.init +Source3: atd.sysconf Patch0: at-3.1.7-lockfile.patch Patch1: at-3.1.10-makefile.patch Patch2: at-3.1.10-man-timespec-path.patch @@ -24,6 +25,7 @@ Patch7: at-3.1.8-t_option.patch Patch8: at-3.1.10-pam.patch Patch9: at-3.1.10-dont_fork.patch Patch10: at-3.1.10-perm.patch +Patch11: at-3.1.10-opt_V.patch BuildRequires: fileutils chkconfig /etc/init.d BuildRequires: flex bison autoconf @@ -68,6 +70,7 @@ cp %{SOURCE1} . %patch8 -p1 -b .pam %patch9 -p1 -b .dont_fork %patch10 -p1 -b .perm +%patch11 -p1 -b .opt_V %build # patch10 touches configure.in @@ -124,6 +127,9 @@ rm -f %{buildroot}/%{_mandir}/man5/at_deny.5 ln -s at.allow.5 \ %{buildroot}/%{_mandir}/man5/at.deny.5 +mkdir -p %{buildroot}/etc/sysconfig +install -m 755 %{SOURCE3} %{buildroot}/etc/sysconfig/atd + # remove unpackaged files from the buildroot rm -r %{buildroot}%{_prefix}/doc @@ -134,6 +140,7 @@ rm -rf %{buildroot} touch %{_localstatedir}/spool/at/.SEQ chmod 600 %{_localstatedir}/spool/at/.SEQ chown daemon:daemon %{_localstatedir}/spool/at/.SEQ +# must be in chkconfig on /sbin/chkconfig --add atd %preun @@ -152,6 +159,7 @@ fi %doc docs/* %config(noreplace) %{_sysconfdir}/at.deny %attr(0700,root,root) %{_sysconfdir}/rc.d/init.d/atd +%attr(0700,root,root) %{_sysconfdir}/sysconfig/atd %attr(0700,daemon,daemon) %dir %{_localstatedir}/spool/at %attr(0600,daemon,daemon) %verify(not md5 size mtime) %ghost %{_localstatedir}/spool/at/.SEQ %attr(0700,daemon,daemon) %dir %{_localstatedir}/spool/at/spool @@ -165,6 +173,11 @@ fi %attr(4755,root,root) %{_bindir}/at %changelog +* Tue Jul 9 2007 Marcela Maslanova - 3.1.10-14 +- feature: add configuration file +- fix -V option +- fix init script + * Tue Jul 3 2007 Marcela Maslanova - 3.1.10-13 - Resolves: rhbz#243064 diff --git a/atd.init b/atd.init index 894e32f..e97d73a 100755 --- a/atd.init +++ b/atd.init @@ -13,35 +13,32 @@ # Source function library. . /etc/init.d/functions -test -x /usr/sbin/atd || exit 0 +# pull in sysconfig settings +[ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd RETVAL=0 - -# -# See how we were called. -# +prog="atd" +ATD=/usr/sbin/atd +LOCK_FILE=/var/lock/subsys/atd prog="atd" start() { # Check if atd is already running - if [ ! -f /var/lock/subsys/atd ]; then echo -n $"Starting $prog: " - daemon /usr/sbin/atd + ##daemon /usr/sbin/atd + $ATD $OPTIONS && success || failure RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atd + [ "$RETVAL" = 0 ] && touch $LOCK_FILE echo - fi - return $RETVAL } stop() { echo -n $"Stopping $prog: " - killproc /usr/sbin/atd + killproc $ATD RETVAL=$? - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/atd + [ "$RETVAL" = 0 ] && rm -f $LOCK_FILE echo - return $RETVAL } @@ -51,13 +48,16 @@ restart() { } reload() { - restart + echo -n $"Reloading $prog: " + if [ -n "`pidfileofproc $ATD`" ]; then + killproc $ATD -HUP + else + failure $"Reloading $prog" + fi + RETVAL=$? + echo } -status_at() { - status /usr/sbin/atd -} - case "$1" in start) start @@ -65,21 +65,27 @@ start) stop) stop ;; -reload|restart) - restart +restart) + stop + start + ;; +reload) + reload ;; condrestart) - if [ -f /var/lock/subsys/atd ]; then - restart + if [ -f $LOCK_FILE ]; then + if [ "$RETVAL" = 0]; then + stop + sleep 3 + start + fi fi ;; status) - status_at + status $ATD ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 esac - -exit $? exit $RETVAL