rpms/vixie-cron/F-8 initscript.patch, NONE, 1.1 syntactic_check.patch, NONE, 1.1 vixie-cron.spec, 1.112, 1.113

Marcela Mašláňová mmaslano at fedoraproject.org
Thu Oct 30 11:35:09 UTC 2008


Author: mmaslano

Update of /cvs/pkgs/rpms/vixie-cron/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31919

Modified Files:
	vixie-cron.spec 
Added Files:
	initscript.patch syntactic_check.patch 
Log Message:
* Thu Oct 30 2008 Marcela Mašláňová <mmaslano at redhat.com> - 4:4.2-9
- fix init script
- syntactic check of RH_CROND_DIR


initscript.patch:

--- NEW FILE initscript.patch ---
diff -up vixie-cron-4.2/vixie-cron.init.old vixie-cron-4.2/vixie-cron.init
--- vixie-cron-4.2/vixie-cron.init.old	2007-08-28 12:52:23.000000000 +0200
+++ vixie-cron-4.2/vixie-cron.init	2008-10-30 12:11:20.000000000 +0100
@@ -11,6 +11,10 @@
 # config: /etc/crontab
 # pidfile: /var/run/crond.pid
 
+[ -f /etc/sysconfig/crond ] || { 
+    [ "$1" = "status" ] && exit 4 || exit 6 
+}
+
 RETVAL=0
 prog="crond"
 CROND=/usr/sbin/crond
@@ -28,14 +32,13 @@ LOCK_FILE=/var/lock/subsys/crond
 t=${CRON_VALIDATE_MAILRCPTS:-UNSET}
 [ "$t" != "UNSET" ] && export CRON_VALIDATE_MAILRCPTS="$t"
  
-prog="crond"
-
 start() {
 	echo -n $"Starting $prog: "
 	daemon $prog $CRONDARGS && success || failure
 	RETVAL=$?
-	[ "$RETVAL" = 0 ] && touch $LOCK_FILE
 	echo
+	[ "$RETVAL" = 0 ] && touch $LOCK_FILE
+	return $RETVAL
 }
 
 stop() {
@@ -47,8 +50,9 @@ stop() {
 		failure $"Stopping $prog"
 	fi
 	RETVAL=$?
-	[ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
 	echo
+	[ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
+	return $RETVAL
 }	
 
 reload() {

syntactic_check.patch:

--- NEW FILE syntactic_check.patch ---
>From 0f6da41030819421a6744a4c800e14b5f7e8ee74 Mon Sep 17 00:00:00 2001
From: Marcela Maslanova <marca at dhcp-lab-135.englab.brq.redhat.com>
Date: Tue, 2 Oct 2007 12:41:51 +0200
Subject: [PATCH] The jobs in RH_CROND_DIR weren't syntactically checked.
 Also SYSCRON wasn't checked. The problem is reported into log.

---
 src/user.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/user.c b/src/user.c
index 2105850..16121ba 100644
--- a/src/user.c
+++ b/src/user.c
@@ -28,6 +28,13 @@ static char rcsid[] = "$Id: user.c,v 1.5 2004/01/23 18:56:43 vixie Exp $";
 
 #include "cron.h"
 
+static const char *FileName;
+
+static void
+log_error(const char *msg) {
+        syslog(LOG_ERR,"CRON: error in (%s) problem is (%s)",FileName,msg);
+}
+
 void
 free_user(user *u) {
 	entry *e, *ne;
@@ -101,7 +108,8 @@ load_user(int crontab_fd, struct passwd	*pw, const char *uname, const char *fnam
 			u = NULL;
 			goto done;
 		case FALSE:
-			e = load_entry(file, NULL, pw, envp);
+			FileName = tabname;
+			e = load_entry(file, log_error, pw, envp);
 			if (e) {
 				e->next = u->crontab;
 				u->crontab = e;
-- 
1.6.0.3



Index: vixie-cron.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vixie-cron/F-8/vixie-cron.spec,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- vixie-cron.spec	12 Feb 2008 13:09:15 -0000	1.112
+++ vixie-cron.spec	30 Oct 2008 11:34:39 -0000	1.113
@@ -10,7 +10,7 @@
 Summary: The Vixie cron daemon for executing specified programs at set times
 Name: vixie-cron
 Version: 4.2
-Release: 8%{?dist}
+Release: 9%{?dist}
 Epoch: 4
 License: BSD
 Group: System Environment/Base
@@ -20,6 +20,8 @@
 Patch2: cred.patch
 Patch3: configure.patch
 Patch4: selinux.perm.patch
+Patch5: syntactic_check.patch
+Patch6: initscript.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: syslog, bash >= 2.0
@@ -59,6 +61,8 @@
 %patch2 -p1 -b .cred
 %patch3 -p1 -b .conf
 %patch4 -p1 -b .selinux
+%patch5 -p1 -b .syntax
+%patch6 -p1
 
 aclocal
 autoheader
@@ -142,6 +146,10 @@
 %doc %{_datadir}/doc/cron/*
 
 %changelog
+* Thu Oct 30 2008 Marcela Mašláňová <mmaslano at redhat.com> - 4:4.2-9
+- fix init script
+- syntactic check of RH_CROND_DIR
+
 * Tue Feb 12 2008 Marcela Maslanova <mmaslano at redhat.com> - 4:4.2-8
 - 426004 forgot change the permission on /etc/cron.d/ 
 




More information about the scm-commits mailing list