Accepting request 49010 from Base:System

Copy from Base:System/cronie based on submit request 49010 from user elvigia

OBS-URL: https://build.opensuse.org/request/show/49010
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cronie?expand=0&rev=1
This commit is contained in:
OBS User autobuild 2010-09-27 15:40:15 +00:00 committed by Git OBS Bridge
commit 2d0a5007f2
15 changed files with 1779 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

161
cron.init Normal file
View File

@ -0,0 +1,161 @@
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Werner Fink <werner@suse.de>, 1996-2001
#
# /etc/init.d/cron
#
# and symbolic its link
#
# /usr/sbin/rccron
#
# System startup script for the cron daemon
#
### BEGIN INIT INFO
# Provides: cron
# Required-Start: $remote_fs $syslog $time
# Should-Start: $network smtp
# Required-Stop: $remote_fs $syslog
# Should-Stop: $network smtp
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Cron job service
# Description: Cron job service
### END INIT INFO
CRON_BIN=/usr/sbin/cron
test -x $CRON_BIN || exit 5
PIDFILE=/var/run/cron.pid
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
allow_deny_move_info() {
echo "WARNING: /var/spool/cron/allow and /var/spool/cron/deny have moved"
echo "to /etc/cron.allow and /etc/cron.deny."
echo "Please merge or move these files to get cron access rules restored."
}
case "$1" in
start)
for al_de in {allow,deny}{,.rpmsave,.rpmorig} ; do
if [ -f /var/spool/cron/$al_de ] ; then
allow_deny_move_info
break
fi
done
echo -n "Starting CRON daemon"
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
# NOTE: startproc return 0, even if service is
# already running to match LSB spec.
startproc -p $PIDFILE $CRON_BIN
#startproc -f $CRON_BIN
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down CRON daemon"
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
killproc -TERM -p $PIDFILE $CRON_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
echo -n "Reload service Cron"
## if it supports it:
## cron monitors /etc/crontab anyway
checkproc $CRON_BIN
rc_status -v
## Otherwise:
#$0 stop && $0 start
#rc_status
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
## Otherwise if it does not support reload:
rc_status -v
;;
status)
echo -n "Checking for Cron: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc $CRON_BIN
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

88
cron.xml Normal file
View File

@ -0,0 +1,88 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2008 Novell, Inc. All rights reserved.
Service Description XML Document for sshd.
This file should be placed in /usr/share/omc/svcinfo.d
Note: The name of the service is the name of this file without the .xml
file extension.
-->
<serviceDescription version="1.0">
<!-- Caption for display purposes -->
<caption>CRON daemon</caption>
<!-- Description of this service -->
<description>
CRON Job Service
</description>
<!--
The startCommand tag specifies the command line that will be
invoked to start the service. The return code from this command
must be as follows:
0 - success
1 - generic or unspecified error
2 - invalid or excess argument(s)
3 - unimplemented feature (e.g. "reload")
4 - user had insufficient privileges
5 - program is not installed
6 - program is not configured
7 - program is not running
-->
<startCommand>/usr/sbin/rccron start</startCommand>
<!--
The reStartCommand tag specifies the command line that will be
invoked to restart the service. The return code from this command
must be as specified in the startCommand tag.
-->
<reStartCommand>/usr/sbin/rccron restart</reStartCommand>
<!--
The stopCommand tag specifies the command line that will be
invoked to stop the service. The return code from this command
must be as specified in the startCommand tag.
-->
<stopCommand>/usr/sbin/rccron stop</stopCommand>
<!--
The statusCommand specifies the command line that can be run
that will report on the status of the service. The return code
from this command line should be as follows:
0 - service up and running
1 - service dead, but /var/run/ pid file exists
2 - service dead, but /var/lock/ lock file exists
3 - service not running (unused)
4 - service status unknown :-(
-->
<statusCommand>/usr/sbin/rccron status</statusCommand>
<!--
The processInformation tag allows the XML Service provider to
identify the processes that belong to the service. This allows
the ServiceProcess associations to be instrumented.
If the process_information tag is not specifed, the will be no
ServiceProcess association for the service.
-->
<processInformation>
<name>cron</name>
<modulePath>/usr/sbin/cron</modulePath>
</processInformation>
<!--
Define the services that this service has a dependency on.
There must be a corresponding Service Description XML file
for the antecedent service in the /etc/omc/svcinfo.d directory.
-->
<dependsOn>
<serviceName>syslog</serviceName>
</dependsOn>
</serviceDescription>

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:720811c8d4a2c6fa7a27c06e151922a65240323e377ff6507c09bb00c8a7b1c5
size 83033

13
cronie-crond_pid.diff Normal file
View File

@ -0,0 +1,13 @@
Index: cronie-1.4.4/src/pathnames.h
===================================================================
--- cronie-1.4.4.orig/src/pathnames.h
+++ cronie-1.4.4/src/pathnames.h
@@ -41,7 +41,7 @@
#else
# define PIDDIR SYSCONFDIR "/"
#endif
-#define PIDFILE "crond.pid"
+#define PIDFILE "cron.pid"
#define _PATH_CRON_PID PIDDIR PIDFILE
#define REBOOT_LOCK PIDDIR "cron.reboot"

78
cronie-nheader_lines.diff Normal file
View File

@ -0,0 +1,78 @@
Index: cronie-1.4.3/src/crontab.c
===================================================================
--- cronie-1.4.3.orig/src/crontab.c
+++ cronie-1.4.3/src/crontab.c
@@ -33,7 +33,7 @@
# include <selinux/av_permissions.h>
#endif
-#define NHEADER_LINES 0
+#define NHEADER_LINES 3
enum opt_t {opt_unknown, opt_list, opt_delete, opt_edit, opt_replace};
@@ -347,7 +347,7 @@ static char *tmp_path() {
static void edit_cmd(void) {
char n[MAX_FNAME], q[MAX_TEMPSTR], *editor;
FILE *f;
- int ch = '\0', t;
+ int ch = '\0', t, x;
struct stat statbuf;
struct utimbuf utimebuf;
WAIT_T waiter;
@@ -399,13 +399,25 @@ static void edit_cmd(void) {
}
Set_LineNum(1)
- /*
- * NHEADER_LINES processing removed for clarity
- * (NHEADER_LINES == 0 in all Red Hat crontabs)
- */
- /* copy the rest of the crontab (if any) to the temp file.
- */
- if (EOF != ch)
+
+ /* ignore the top few comments since we probably put them there.
+ */
+ x = 0;
+ while (EOF != (ch = get_char(f))) {
+ if ('#' != ch) {
+ putc(ch, NewCrontab);
+ break;
+ }
+ while (EOF != (ch = get_char(f)))
+ if (ch == '\n')
+ break;
+ if (++x >= NHEADER_LINES)
+ break;
+ }
+
+ /* copy the rest of the crontab (if any) to the temp file.
+ */
+ if (EOF != ch)
while (EOF != (ch = get_char(f)))
putc(ch, NewCrontab);
@@ -605,6 +617,7 @@ static int replace_cmd(void) {
int error = 0;
entry *e;
uid_t file_owner;
+ time_t now = time(NULL);
char **envp = env_init();
if (envp == NULL) {
@@ -636,10 +649,10 @@ static int replace_cmd(void) {
*
* VERY IMPORTANT: make sure NHEADER_LINES agrees with this code.
*/
- /*fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n");
- *fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now));
- *fprintf(tmp, "# (Cron version %s)\n", CRON_VERSION);
- */
+ fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n");
+ fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now));
+ fprintf(tmp, "# (Cronie version %s)\n", CRON_VERSION);
+
#ifdef WITH_SELINUX
if (selinux_context)
fprintf(tmp, "SELINUX_ROLE_TYPE=%s\n", selinux_context);

20
cronie-pam_config.diff Normal file
View File

@ -0,0 +1,20 @@
w
Index: cronie-1.4.4/pam/crond
===================================================================
--- cronie-1.4.4.orig/pam/crond
+++ cronie-1.4.4/pam/crond
@@ -3,8 +3,9 @@
#
#
# No PAM authentication called, auth modules not needed
-account required pam_access.so
-account include password-auth
-session required pam_loginuid.so
-session include password-auth
-auth include password-auth
+auth sufficient pam_rootok.so
+auth include common-auth
+account include common-account
+password include common-password
+session required pam_loginuid.so
+session include common-session

4
cronie-rpmlintrc Normal file
View File

@ -0,0 +1,4 @@
# This line is mandatory to access the configuration functions
from Config import *
addFilter("cronie.* incoherent-init-script-name")

870
cronie.changes Normal file
View File

@ -0,0 +1,870 @@
-------------------------------------------------------------------
Thu Aug 26 01:34:34 UTC 2010 - cristian.rodriguez@opensuse.org
- Update to cronie 1.4.5
- drop upstreamed patches in particular minuslog and pam_conv.
- cronie can work without sendmail now, if absent syslog is used.
-------------------------------------------------------------------
Wed Apr 7 18:50:23 UTC 2010 - mseben@novell.com
- added crond_pid.diff to finaly fix cron.pid issue which breaks
init script
-------------------------------------------------------------------
Thu Mar 25 14:28:30 UTC 2010 - mseben@novell.com
- updated to version 1.4.4
* src/crontab.c: CVE-2010-0424 -- crontab -e crontab file timestamp
race condition
* configure.ac: Dynamic shared libraries -laudit There is need to
add -laudit into gcc options because now it's no found automatically.
* man/anacrontab.5: Make man page more readable based on #564206.
* crond.sysconfig, cronie.init: CRON_VALIDATE_MAILRCPTS was removed,
because it was not used anyway.
* src/do_command.c, src/funcs.h, src/security.c: With NFS homes
can't be job executed, because root can't access this directory.
* man/cron.8, src/do_command.c: Disable mailing output.
* man/cron.8, src/cron.c, src/do_command.c, src/globals.h: Output
could be redirectered to syslog.
* src/security.c: Cron doesn't use environment values from
/etc/security/pam_env.conf. This was fixed by moving pam_setcred
into first part of authentication of pam.
* cronie.init: Initscript: if unprivileged user stop deamon, it
should return 4.
* cronie.init: Initscript: if unprivileged user restart deamon, it
should return 4.
* src/security.c: This function will be probably removed from
libselinux, so it is added into source code here.
* pam/crond: One line was missing in pam authentication. rhbz#533189
* Makefile.am, configure.ac: Autotools - Makefile includes
dailyjobs, configure has new version.
-------------------------------------------------------------------
Fri Feb 19 13:58:34 UTC 2010 - mseben@novell.com
- added race-mtime_new.patch : to fix crontab -e crontab file
timestamp race condition (bnc#580800) (CVE-2010-0424)
-------------------------------------------------------------------
Wed Feb 3 22:03:53 UTC 2010 - mseben@novell.com
- added nheader_lines.diff : ignore top three lines of comments in
crontab file when user use crontab -e
- added $RPM_OPT_FLAGS to build stage
-------------------------------------------------------------------
Sat Dec 19 18:13:04 CET 2009 - jengelh@medozas.de
- enable parallel build
-------------------------------------------------------------------
Thu Dec 17 07:28:54 UTC 2009 - mseben@novell.com
- added subpackage cronie-anacron
-------------------------------------------------------------------
Wed Dec 9 12:24:49 UTC 2009 - mseben@novell.com
- added pam_conv.diff to add pam conversationfrom function
- added pam_config.diff to add pam config file from old cron
- added Provides: cron = 4.2, Obsoletes: cron <= 4.1
- added SPOOL_DIR="/var/spool/cron/tabs" to build section to correct
tabs dir for users
-------------------------------------------------------------------
Tue Dec 8 17:03:14 UTC 2009 - mseben@novell.com
- added minuslog.diff and remove_old_system.diff
from cron package
-------------------------------------------------------------------
Mon Dec 7 22:49:49 UTC 2009 - crrodriguez@opensuse.org
- enable anacron build
- enable audit support
- cleanup spec file a bit
-------------------------------------------------------------------
Sat Dec 5 21:36:57 UTC 2009 - mseben@novell.com
- switch to cronie 1.4.3, see project page :
https://fedorahosted.org/cronie/
- anacron and audit support disabled for now
- /usr/sbin/cron renamed to /usr/sbin/crond
-------------------------------------------------------------------
Fri Nov 27 10:08:49 UTC 2009 - mseben@novell.com
- added initgroups_check.patch : verify return value of
initgroups (bnc#537178) (CVE-2006-2607)
-------------------------------------------------------------------
Wed Nov 18 17:18:44 UTC 2009 - mseben@novell.com
- added pam conversion function (reworked pam.diff) fate#306386
-------------------------------------------------------------------
Wed Nov 18 14:39:49 UTC 2009 - mseben@novell.com
- modified run-crons script : added support for new SEND_OUTPUT_ON_NO_ERROR
sysconfig option to block status mails from cron jobs with empty
output (fate#305279)
-------------------------------------------------------------------
Tue Nov 3 19:09:11 UTC 2009 - coolo@novell.com
- updated patches to apply with fuzz=0
-------------------------------------------------------------------
Wed Oct 14 18:28:22 CEST 2009 - ro@suse.de
- init script: remove "-p $PIDFILE" from startproc call
(until startproc does allow to combine -f and -p again)
-------------------------------------------------------------------
Fri Aug 22 16:42:20 CEST 2008 - prusnak@suse.cz
- added -DWITH_SELINUX to DEFS
-------------------------------------------------------------------
Thu Aug 21 01:52:40 CEST 2008 - ro@suse.de
- remove outdated options from fillup_and_insserv call
-------------------------------------------------------------------
Wed Aug 20 15:20:06 CEST 2008 - mkoenig@suse.de
- enable SELinux support [fate#303662]
-------------------------------------------------------------------
Wed Aug 13 15:25:44 CEST 2008 - mkoenig@suse.de
- fix init script tags
-------------------------------------------------------------------
Wed Jan 16 10:46:36 CET 2008 - mskibbe@suse.de
- Fate #301837: CRON XLM Service Description Document
-------------------------------------------------------------------
Tue Jan 8 13:16:38 CET 2008 - coolo@suse.de
- let cron recommend postfix, so that the package solver knows
that one of the smtp_daemons is preferred by the distribution
in case the user has no further input on this (#351027)
-------------------------------------------------------------------
Wed Dec 12 10:56:51 CET 2007 - mkoenig@suse.de
- remove old *system* entries before database reload to avoid
comparing wrong mtimes. [#344667]
-------------------------------------------------------------------
Mon Dec 10 13:19:01 CET 2007 - mkoenig@suse.de
- prevent cron.monthly running twice in a month [#338474]
-------------------------------------------------------------------
Wed Dec 5 15:47:53 CET 2007 - mkoenig@suse.de
- revert last change, it was wrong [#346150]
-------------------------------------------------------------------
Wed Nov 28 12:10:12 CET 2007 - mkoenig@suse.de
- fix calculation of time difference in run-crons script
-------------------------------------------------------------------
Tue Nov 27 17:03:55 CET 2007 - mkoenig@suse.de
- fix problem with DAILY_TIME set to 00:00
-------------------------------------------------------------------
Wed Nov 7 10:57:07 CET 2007 - mkoenig@suse.de
- add %fillup_prereq and %insserv_prereq to Prereq
-------------------------------------------------------------------
Tue Oct 16 14:17:35 CEST 2007 - mkoenig@suse.de
- move ac power test to the beginning of the run_crons script,
to avoid creation of the tmpdir [#333751]
-------------------------------------------------------------------
Tue Jun 19 18:48:21 CEST 2007 - dmueller@suse.de
- cron should depend on smtp
-------------------------------------------------------------------
Wed Jun 13 17:56:42 CEST 2007 - mkoenig@suse.de
- fix another cron.daily run twice bug [#283218]
-------------------------------------------------------------------
Thu Mar 29 15:31:22 CEST 2007 - mkoenig@suse.de
- Restrict hardlink check to avoid potential DOS attacks [#258372]
-------------------------------------------------------------------
Fri Mar 9 12:47:22 CET 2007 - mkoenig@suse.de
- use pid file for start/stop [#248163]
-------------------------------------------------------------------
Tue Feb 16 10:31:20 CET 2007 - mkoenig@suse.de
- avoid duplicate source of sysconfig [#244513]
- fix bug in run-crons, which lets cron.daily run twice
for certain values of DAILY_TIME [#244977]
-------------------------------------------------------------------
Mon Feb 12 17:39:11 CET 2007 - mkoenig@suse.de
- load database right after daemon awakes [#243020]
-------------------------------------------------------------------
Fri Feb 9 11:40:30 CET 2007 - mkoenig@suse.de
- use norootforbuild
-------------------------------------------------------------------
Tue Feb 6 17:00:40 CET 2007 - mkoenig@suse.de
- set PAM_TTY [#242586]
-------------------------------------------------------------------
Wed Sep 27 14:27:22 CEST 2006 - mkoenig@suse.de
- relax requirements on crontab permissions [#207645]
-------------------------------------------------------------------
Fri Sep 1 14:22:21 CEST 2006 - kukuk@suse.de
- Add pam_loginuid.so to PAM config
-------------------------------------------------------------------
Wed Aug 23 11:39:42 CEST 2006 - mkoenig@suse.de
- fixed segfault bug [#199153]
-------------------------------------------------------------------
Mon May 29 16:49:48 CEST 2006 - kssingvo@suse.de
- fixed priviledge escalation bug CVE-2006-2607 (bugzilla#178863)
-------------------------------------------------------------------
Tue Mar 28 12:01:31 CEST 2006 - hvogel@suse.de
- really enable PAM [#160426]
-------------------------------------------------------------------
Sat Mar 11 15:00:45 CET 2006 - schwab@suse.de
- Fix last change.
-------------------------------------------------------------------
Tue Feb 28 17:40:43 CET 2006 - hvogel@suse.de
- add $network to Should-Start of the init script to avoid
cron starting before network [#151141]
-------------------------------------------------------------------
Wed Jan 25 21:35:13 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Mon Jan 16 14:08:14 CET 2006 - mmj@suse.de
- Build with -fstack-protector
-------------------------------------------------------------------
Mon Jan 16 12:40:06 CET 2006 - mmj@suse.de
- Make editors which do not modify original also work [#143209]
-------------------------------------------------------------------
Mon Jan 16 11:50:40 CET 2006 - mmj@suse.de
- Add the possibility to log also successful jobs, and introduce
sysconfig variables to control this [#135619]
-------------------------------------------------------------------
Mon Jan 16 11:34:00 CET 2006 - mmj@suse.de
- Send mail as user executing the cronjob [#140905]
-------------------------------------------------------------------
Sat Jan 14 22:21:42 CET 2006 - schwab@suse.de
- Don't strip binaries.
-------------------------------------------------------------------
Wed Jan 11 14:17:23 CET 2006 - mlasars@suse.de
- changed run-crons to run cron.daily at a designated
time (#114761).
-------------------------------------------------------------------
Tue Dec 6 14:18:20 CET 2005 - mmj@suse.de
- Make sure SELinux is disabled
-------------------------------------------------------------------
Thu Aug 25 13:56:56 CEST 2005 - kukuk@suse.de
- Fix permission of installed PAM config file
-------------------------------------------------------------------
Fri Jun 17 02:52:33 CEST 2005 - mmj@suse.de
- Compile with -fpie, link with -pie
-------------------------------------------------------------------
Wed Jun 15 11:25:56 CEST 2005 - mmj@suse.de
- Remove LAuS
-------------------------------------------------------------------
Thu May 12 17:26:33 CEST 2005 - meissner@suse.de
- use RPM_OPT_FLAGS -Wno-comment
-------------------------------------------------------------------
Wed Apr 27 10:36:49 CEST 2005 - mmj@suse.de
- use find -cmin instead of -ctime in run-crons [#80435]
- use /etc/cron.{allow,deny} instead of
/var/spool/cron/{allow,deny} [#80273]
-------------------------------------------------------------------
Mon Mar 7 14:32:07 CET 2005 - mmj@suse.de
- ignore .svn directories [#71052]
-------------------------------------------------------------------
Mon Mar 7 11:43:59 CET 2005 - mmj@suse.de
- rm commands in /etc/crontab are redundant [#71017]
-------------------------------------------------------------------
Fri Feb 25 15:47:30 CET 2005 - ro@suse.de
- explicitly set permissions for /var/spool/cron{,/tabs}
-------------------------------------------------------------------
Wed Jan 12 12:16:00 CET 2005 - kukuk@suse.de
- Add PAM support
-------------------------------------------------------------------
Mon Jan 10 11:46:55 CET 2005 - mmj@suse.de
- Don't source /etc/rc.status twice [#49673]
-------------------------------------------------------------------
Fri Oct 1 15:48:21 CEST 2004 - mmj@suse.de
- Add the old SuSE patch to be able to specify a "-" before a cron-
tab entry and then disable logging [#45611]
-------------------------------------------------------------------
Thu Sep 30 13:04:16 CEST 2004 - mmj@suse.de
- Add correct permissions handling
- Fix swap_uids_back() function
-------------------------------------------------------------------
Wed Sep 22 10:12:49 CEST 2004 - mmj@suse.de
- Remove selinux support since it's broken at the moment [#45611]
-------------------------------------------------------------------
Tue Sep 14 17:32:59 CEST 2004 - mmj@suse.de
- Make run-crons up to date with laptops ac stuff [#45248]
-------------------------------------------------------------------
Tue Sep 14 01:17:01 CEST 2004 - ro@suse.de
- make laus stuff conditional
-------------------------------------------------------------------
Tue Aug 31 16:18:52 CEST 2004 - mmj@suse.de
- Remove update functionality from the last millenium
- Clean out notify mails [#44347]
- Clean up spec file a bit
-------------------------------------------------------------------
Tue Aug 31 07:45:27 CEST 2004 - mmj@suse.de
- Add patch to be more relaxed with permissions [#44304] [#44470]
-------------------------------------------------------------------
Wed Aug 25 11:04:26 CEST 2004 - thomas@suse.de
- added laus patch
-------------------------------------------------------------------
Tue Aug 24 19:20:32 CEST 2004 - mmj@suse.de
- New cron has slightly changed semantics, so invoke process_crontab
correctly and make system crontabs works again
-------------------------------------------------------------------
Mon Aug 23 20:19:10 CEST 2004 - mmj@suse.de
- Add missing hunk to control when we reload the db
- Remove laus and laus-devel from neededforbuild for now
- Use same pathnames as before
-------------------------------------------------------------------
Mon Aug 23 14:33:33 CEST 2004 - mmj@suse.de
- Call make in %build allthough make install implies it's built
-------------------------------------------------------------------
Mon Aug 23 11:50:42 CEST 2004 - mmj@suse.de
- Update to vixie cron 4.1:
o Adapt many Fedora patches including what we had in our
cron-3.0.1 patches
o Add SELinux support
o Add debugging info
- LAuS support for now disabled, will be enabled later
-------------------------------------------------------------------
Tue Apr 6 07:06:26 CEST 2004 - kukuk@suse.de
- fix permissions of crontab
-------------------------------------------------------------------
Fri Mar 26 14:39:45 CET 2004 - thomas@suse.de
- cosmetic changes in spec file (inspired by mmj)
- ironed out hunk shift due to changed line offset in laus
patch
-------------------------------------------------------------------
Wed Mar 24 17:41:58 CET 2004 - thomas@suse.de
- made LAuS support work on x86_64
-------------------------------------------------------------------
Tue Mar 23 16:53:23 CET 2004 - thomas@suse.de
- added LAuS patch
-------------------------------------------------------------------
Thu Oct 2 11:09:58 CEST 2003 - fehr@suse.de
- fix wrong nice level of cron scripts (#31961)
-------------------------------------------------------------------
Thu Sep 18 02:03:17 CEST 2003 - ro@suse.de
- fix typo in run-crons (#31216)
-------------------------------------------------------------------
Tue Aug 26 17:30:59 CEST 2003 - mmj@suse.de
- Don't do it all in the 0'th hour, but the 4th
-------------------------------------------------------------------
Sat Aug 16 19:23:05 CEST 2003 - kukuk@suse.de
- Modify /etc/crontab only if we need to move cron directory
- Try to restart daemon on update
-------------------------------------------------------------------
Thu Jul 3 17:44:44 CEST 2003 - fehr@suse.de
- fix bug in handling of monthly script in /usr/lib/cron/run-crons
(#27704)
- adapt sigcld handling for new kernel (#26011)
-------------------------------------------------------------------
Tue May 27 04:53:46 CEST 2003 - sndirsch@suse.de
- /usr/lib/cron/run-crons: added missing "-n" to specify nice level
-------------------------------------------------------------------
Tue May 6 10:32:36 CEST 2003 - fehr@suse.de
- Fix bug in quoting patch (#26675)
-------------------------------------------------------------------
Wed Apr 16 09:15:19 CEST 2003 - coolo@suse.de
- use BuildRoot
-------------------------------------------------------------------
Mon Mar 24 10:37:25 CET 2003 - fehr@suse.de
- Add improved version of cron_number_check.patch from Gernot Payer
-------------------------------------------------------------------
Thu Mar 20 15:36:35 CET 2003 - fehr@suse.de
- Fix wrong check for number, thanks to Gernot Payer <gpayer@suse.de>
(#25680)
-------------------------------------------------------------------
Fri Feb 28 09:31:00 CET 2003 - fehr@suse.de
- Fix quoting problem with % in crontab, thanks to Klaus G. Wagner
<kgw@suse.de> (#17713)
-------------------------------------------------------------------
Thu Feb 13 13:46:50 CET 2003 - mmj@suse.de
- Do not own /etc/cron.d* since we might want to use other cron
versions.
-------------------------------------------------------------------
Tue Nov 5 14:07:54 CET 2002 - ro@suse.de
- fixed bogus self-provides
-------------------------------------------------------------------
Tue Nov 5 14:06:57 CET 2002 - ro@suse.de
- fixed typo in run-crons script (ouput->output) (#21497)
-------------------------------------------------------------------
Thu Aug 15 12:11:42 CEST 2002 - fehr@suse.de
- add PreReq tag to spec file
-------------------------------------------------------------------
Mon Aug 5 09:25:02 CEST 2002 - kukuk@suse.de
- Use $time instead of xntpd
- Make sendmail/postfix "Should-Start"
-------------------------------------------------------------------
Wed Jul 3 01:23:41 MEST 2002 - draht@suse.de
- crontab(1) must not leak fd for /var/spool/cron/deny and/or
/var/spool/cron/allow to the user's editor (security).
-------------------------------------------------------------------
Thu Apr 25 15:19:31 CEST 2002 - fehr@suse.de
- added newline to run-cron output (#15796)
-------------------------------------------------------------------
Fri Mar 1 14:46:16 CET 2002 - egmont@suselinux.hu
- fix month/day interval in manpage
-------------------------------------------------------------------
Thu Feb 21 10:46:21 CET 2002 - ro@suse.de
- logger is in /bin, adapt run-crons script
-------------------------------------------------------------------
Mon Feb 4 11:36:37 CET 2002 - fehr@suse.de
- fix reload option of init-script (#13026)
-------------------------------------------------------------------
Thu Jan 24 10:15:55 CET 2002 - ro@suse.de
- modified fillup_and_insserv call (perl-hack not needed here)
-------------------------------------------------------------------
Fri Jan 18 00:45:15 CET 2002 - ro@suse.de
- fixed initscript comments
-------------------------------------------------------------------
Thu Jan 10 14:24:52 CET 2002 - ro@suse.de
- removed test for CRON variable from init script
-------------------------------------------------------------------
Wed Dec 12 17:07:57 CET 2001 - fehr@suse.de
- fix wrong sigchld handling (thanks to Philip Willoughby)
- changed to new init script handling
-------------------------------------------------------------------
Fri Sep 28 16:39:59 CEST 2001 - ro@suse.de
- removed duplicate trap in run-crons (#11472)
-------------------------------------------------------------------
Thu Sep 13 16:23:03 CEST 2001 - ro@suse.de
- updated run-crons (feedback from volker_apelt, thanks)
-------------------------------------------------------------------
Fri Sep 7 18:00:38 CEST 2001 - schwab@suse.de
- Instead of closing std{in,out,err} redirect them to /dev/null.
-------------------------------------------------------------------
Wed Aug 15 11:30:47 CEST 2001 - fehr@suse.de
- add log messages when one of the /etc/cron/cron.* scripts fails
(thanks for suggestion by Steffen Dettmer)
-------------------------------------------------------------------
Mon May 7 19:00:55 MEST 2001 - draht@suse.de
- Added security patch for a wrong setuid() call.
-------------------------------------------------------------------
Tue Apr 24 11:06:31 CEST 2001 - ro@suse.de
- added rc-link
-------------------------------------------------------------------
Mon Apr 23 16:59:30 CEST 2001 - ro@suse.de
- added updated startscript and rc.config variable
-------------------------------------------------------------------
Thu Apr 12 14:02:35 CEST 2001 - werner@suse.de
- Close stdin, stdout, and stderr on forking of the daemon.
-------------------------------------------------------------------
Wed Feb 14 14:55:26 MET 2001 - fehr@suse.de
- add patch to prevent buffer overflow with usernames longer than
19 characters
-------------------------------------------------------------------
Tue Feb 6 10:13:27 MET 2001 - fehr@suse.de
- Make it compile with new glibc
- remove calls to fax utilities and texpire from default crontab
-------------------------------------------------------------------
Tue Dec 12 17:07:17 CET 2000 - werner@suse.de
- Add cron.hourly because we provide /etc/cron.hourly/
- Remove lock files not at same time but with a quater offset
- Don't run *.rpmorig, *.rpmnew, *.rmpsave, *.swap, *.bak, *~, #*
- Don run a script if it is already running
- Remove `echo' to enable DTS patch of Thomas
-------------------------------------------------------------------
Fri Dec 8 11:35:16 MET 2000 - fehr@suse.de
- fix bug introduced in last change
-------------------------------------------------------------------
Mon Nov 20 16:02:06 MET 2000 - fehr@suse.de
- add security patch from Daniel Jacobowitz to cron
- prevent cron.daily called twice when changing from DST to normal (#998)
-------------------------------------------------------------------
Wed Nov 15 18:15:59 MET 2000 - fehr@suse.de
- add most of the patches of Chris D. Faulhaber (jedgar@fxp.org) (#4249)
-------------------------------------------------------------------
Tue Sep 5 16:49:14 MEST 2000 - fehr@suse.de
- make sematic of cron.monthly clearer. It is now executed on the
first check in run-crons executed in a month but at most once
per month. Older semantic was to execute every 30 days which
resulted in being called twice per month when month has 31 days
and first execution was on 1st day of month. (#3850)
-------------------------------------------------------------------
Fri Jul 21 14:20:45 MEST 2000 - fehr@suse.de
- fix the use of ifdef __linux__ (everywhere else __linux is used)
-------------------------------------------------------------------
Wed May 31 10:39:17 MEST 2000 - fehr@suse.de
- Start script with "nice -15"
-------------------------------------------------------------------
Mon May 22 15:44:36 CEST 2000 - kukuk@suse.de
- Fix post install section
-------------------------------------------------------------------
Tue May 16 15:47:56 CEST 2000 - kukuk@suse.de
- Move /var/cron -> /var/spool/cron (FHS 2.1)
-------------------------------------------------------------------
Sun Feb 27 15:48:47 CET 2000 - kukuk@suse.de
- Move /usr/man -> /usr/share/man
-------------------------------------------------------------------
Mon Jan 24 19:25:24 CET 2000 - uli@suse.de
- added -D__linux to cope with gcc 2.95
-------------------------------------------------------------------
Thu Dec 2 12:27:05 CET 1999 - bs@suse.de
- removed CDR_PROG section from run-crons. this leads to problems in
some network environments.
-------------------------------------------------------------------
Mon Sep 20 17:58:32 CEST 1999 - ro@suse.de
- added Requires smtp_daemon
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Mon Aug 30 10:13:42 MEST 1999 - kukuk@suse.de
- always use fork instead of vfork
-------------------------------------------------------------------
Fri Aug 27 17:23:30 MEST 1999 - fehr@suse.de
- prevent sendmail from being called as root
-------------------------------------------------------------------
Thu Aug 26 11:49:44 MEST 1999 - fehr@suse.de
- fixed some possible buffer overflow exploits
-------------------------------------------------------------------
Fri Jul 23 18:02:55 MEST 1999 - bs@suse.de
- redirect stderr of apm call to /dev/null
-------------------------------------------------------------------
Thu Jul 15 17:12:49 MEST 1999 - bs@suse.de
- don't run cron jobs via run-cron if
o a cd writer is running
o laptop is AC-offline
- /etc/crontab:
o don't log every start of run-crons
o run faxclean only once a day
-------------------------------------------------------------------
Mon Mar 29 18:12:24 MEST 1999 - ro@suse.de
- added cron.d feature from debian-cron
-------------------------------------------------------------------
Mon Feb 1 13:11:13 MET 1999 - bs@suse.de
- merged beta and stable version
- added entries in crontab to delete lastrun files, to let cronjobs be started
at night.
-------------------------------------------------------------------
Fri Jan 8 16:15:54 MET 1999 - bs@suse.de
- changed run-crons to work around finds 'strange behavior'
-------------------------------------------------------------------
Fri Dec 18 15:33:59 MET 1998 - ro@suse.de
- use SIGCHLD instead of SIGCLD
-------------------------------------------------------------------
Tue Dec 15 01:06:31 MET 1998 - bs@suse.de
- fixed xargs in run-crons
-------------------------------------------------------------------
Mon Dec 14 13:25:24 MET 1998 - bs@suse.de
- fixed bug in run-crons
-------------------------------------------------------------------
Mon Dec 14 05:10:31 MET 1998 - bs@suse.de
- added /etc/cron.* feature.
-------------------------------------------------------------------
Tue Nov 17 20:42:58 MET 1998 - bs@suse.de
- added texpire to crontab.
- use noreplace for config files.
-------------------------------------------------------------------
Thu Sep 10 16:39:44 MEST 1998 - bs@suse.de
- fixed problem with non existing var/cron/tabs/root.
-------------------------------------------------------------------
Mon Sep 7 11:53:57 MEST 1998 - bs@suse.de
- fixed check for /var/cron/tabs/root in %post section
----------------------------------------------------------------------------
Mon Jul 7 13:17:08 CEST 1997 - florian@suse.de
- warn if cron.daily is still in /var/cron/tabs/root
- start cron.daily 10 minutes earlier, so that duplicate
entries don't overlap :-(
----------------------------------------------------------------------------
Thu Jun 5 11:08:05 MEST 1997 - florian@suse.de
- use /etc/crontab instead of /var/cron/tabs/root
----------------------------------------------------------------------------
Fri May 16 01:31:24 CEST 1997 - bs@suse.de
- removed *.new -> orig stuff behavior, since is not neded for rpm.
----------------------------------------------------------------------------
Wed Apr 30 15:57:14 CEST 1997 - florian@suse.de
- fix screen output ifrom ALLOW_FILE to DENY_FILE
- do not include syslog.c anymore, libc is fixed
- disable debugging compile time switch
- add some security patches
----------------------------------------------------------------------------
Thu Feb 27 12:30:11 CET 1997 - bs@suse.de
added crontab entries for hylafax.
----------------------------------------------------------------------------
Wed Jan 22 22:24:11 CET 1997 - florian@suse.de
- syslogging works even if syslogd is restarted
----------------------------------------------------------------------
Wed Nov 13 03:08:18 MET 1996 - bs@suse.de
- beautified man page
- store crontab.root.new in /root instead of /tmp
----------------------------------------------------------------------
Tue Sep 24 09:27:17 MET DST 1996 - bs@suse.de
- atrun aus crontab fur root rausgenommen.

161
cronie.spec Normal file
View File

@ -0,0 +1,161 @@
#
# spec file for package cronie (Version 1.4.5_git201007091204)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: cronie
BuildRequires: audit-devel libselinux-devel pam-devel
Url: https://fedorahosted.org/cronie/
License: MIT and BSD and GPLv2
Group: System/Daemons
Requires: smtp_daemon
Recommends: postfix
AutoReqProv: on
PreReq: permissions %fillup_prereq %insserv_prereq
Version: 1.4.5_git201007091204
Release: 1
Summary: Cron Daemon
Source0: %name-%version.tar.bz2
Source1: cron.init
Source2: run-crons
Source3: sample.root
Source4: deny.sample
Source5: cron.xml
Source6: cronie-rpmlintrc
# PATCH-FEATURE-OPENSUSE cronie-pam_config.diff added pam config file from old cron
Patch3: %name-pam_config.diff
# openSUSE set NHEADER_LINES to 3 - old openSUSE cron put three lines of comments
# in top of crontab file, so we want to hide this junk comments if user edit
# crontab file with crontab -e command, patch grabbed from old openSUSE cron
Patch4: %name-nheader_lines.diff
# we use cron.pid instead of crond.pid
Patch5: %name-crond_pid.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: cron = 4.2
Obsoletes: cron <= 4.1
%description
cron automatically starts programs at specific times. Add new entries
with "crontab -e". (See "man 5 crontab" and "man 1 crontab" for
documentation.)
Under /etc, find the directories cron.hourly, cron.daily, cron.weekly,
and cron.monthly. Scripts and programs that are located there are
started automatically.
%package anacron
License: MIT and BSD and GPLv2
Summary: Utility for running regular jobs
Group: System Environment/Base
Requires: %{name} = %{version}
%description anacron
Anacron becames part of cronie. Anacron is used only for running regular jobs.
The default settings execute regular jobs by anacron, however this could be
overloaded in settings.
%prep
%setup -q
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
autoreconf -fiv
# fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked
CFLAGS="$RPM_OPT_FLAGS -DCRON_VERSION=\\\"%{version}\\\""
%configure --with-audit --enable-anacron --with-pam --with-selinux --with-inotify --enable-pie SPOOL_DIR="/var/spool/cron/tabs"
%{__make} %{?jobs:-j%jobs}
%install
%makeinstall
%{__mkdir_p} -v %{buildroot}%{_localstatedir}/spool/cron/{tabs,lastrun}
%{__mkdir_p} -v %{buildroot}%{_sysconfdir}/cron.{d,hourly,daily,weekly,monthly}
%{__install} -v -m 600 %{SOURCE3} %{buildroot}/etc/crontab
%{__install} -v -m 600 %{SOURCE4} %{buildroot}/etc/cron.deny
%{__install} -v -d %{buildroot}/usr/lib/cron
%{__install} -v %{SOURCE2} %{buildroot}/usr/lib/cron
%{__install} -v -d %{buildroot}%{_sysconfdir}/init.d/
%{__install} -v -m744 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/cron
%{__ln_s} -f ../../etc/init.d/cron %{buildroot}/usr/sbin/rccron
%{__install} -m 644 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
%{__install} -c -m755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
%{__mkdir_p} $RPM_BUILD_ROOT/var/spool/anacron
%{__mv} %{buildroot}%{_sbindir}/crond %{buildroot}%{_sbindir}/cron
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.daily
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.weekly
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly
# service xml
%{__install} -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
%{__install} -v -m644 %{S:5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
%post
%{fillup_and_insserv -y cron}
%run_permissions
%verifyscript
%verify_permissions -e /etc/crontab -e /usr/bin/crontab
%preun
%stop_on_removal cron
%postun
%restart_on_update cron
%{insserv_cleanup}
%post anacron
[ -e /var/spool/anacron/cron.daily ] || touch /var/spool/anacron/cron.daily
[ -e /var/spool/anacron/cron.weekly ] || touch /var/spool/anacron/cron.weekly
[ -e /var/spool/anacron/cron.monthly ] || touch /var/spool/anacron/cron.monthly
%files
%defattr(-,root,root)
%doc AUTHORS COPYING INSTALL README ChangeLog
%dir %attr(700,root,root) /var/spool/cron
%dir %attr(700,root,root) /var/spool/cron/tabs
%dir /var/spool/cron/lastrun
%config /etc/init.d/cron
%config /etc/pam.d/crond
%verify(not mode) %config(noreplace) /etc/crontab
%config(noreplace) /etc/cron.deny
%{_mandir}/man1/crontab.1.gz
%{_mandir}/man5/crontab.5.gz
%{_mandir}/man8/cron.8.gz
%{_mandir}/man8/crond.8.gz
%verify(not mode) %attr (4750,root,trusted) /usr/bin/crontab
%attr (755,root,root) %{_sbindir}/cron
%{_sbindir}/rccron
/usr/lib/cron
%config %{_sysconfdir}/omc/srvinfo.d/cron.xml
%dir %{_sysconfdir}/omc/srvinfo.d/
%dir %{_sysconfdir}/omc/
%files anacron
%defattr(-,root,root,-)
%{_sbindir}/anacron
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
%config(noreplace) %{_sysconfdir}/anacrontab
%dir /var/spool/anacron
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.daily
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.weekly
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.monthly
%{_mandir}/man5/anacrontab.*
%{_mandir}/man8/anacron.*
%changelog

88
cronie.xml Normal file
View File

@ -0,0 +1,88 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2008 Novell, Inc. All rights reserved.
Service Description XML Document for sshd.
This file should be placed in /usr/share/omc/svcinfo.d
Note: The name of the service is the name of this file without the .xml
file extension.
-->
<serviceDescription version="1.0">
<!-- Caption for display purposes -->
<caption>CRON daemon</caption>
<!-- Description of this service -->
<description>
CRON Job Service
</description>
<!--
The startCommand tag specifies the command line that will be
invoked to start the service. The return code from this command
must be as follows:
0 - success
1 - generic or unspecified error
2 - invalid or excess argument(s)
3 - unimplemented feature (e.g. "reload")
4 - user had insufficient privileges
5 - program is not installed
6 - program is not configured
7 - program is not running
-->
<startCommand>/usr/sbin/rccron start</startCommand>
<!--
The reStartCommand tag specifies the command line that will be
invoked to restart the service. The return code from this command
must be as specified in the startCommand tag.
-->
<reStartCommand>/usr/sbin/rccron restart</reStartCommand>
<!--
The stopCommand tag specifies the command line that will be
invoked to stop the service. The return code from this command
must be as specified in the startCommand tag.
-->
<stopCommand>/usr/sbin/rccron stop</stopCommand>
<!--
The statusCommand specifies the command line that can be run
that will report on the status of the service. The return code
from this command line should be as follows:
0 - service up and running
1 - service dead, but /var/run/ pid file exists
2 - service dead, but /var/lock/ lock file exists
3 - service not running (unused)
4 - service status unknown :-(
-->
<statusCommand>/usr/sbin/rccron status</statusCommand>
<!--
The processInformation tag allows the XML Service provider to
identify the processes that belong to the service. This allows
the ServiceProcess associations to be instrumented.
If the process_information tag is not specifed, the will be no
ServiceProcess association for the service.
-->
<processInformation>
<name>cron</name>
<modulePath>/usr/sbin/cron</modulePath>
</processInformation>
<!--
Define the services that this service has a dependency on.
There must be a corresponding Service Description XML file
for the antecedent service in the /etc/omc/svcinfo.d directory.
-->
<dependsOn>
<serviceName>syslog</serviceName>
</dependsOn>
</serviceDescription>

1
deny.sample Normal file
View File

@ -0,0 +1 @@
guest

260
run-crons Normal file
View File

@ -0,0 +1,260 @@
#!/bin/bash
#
# /usr/lib/cron/run-crons
#
# Copyright (c) 1998-2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
#
# this script looks into /etc/cron.{hourly,daily,weekly,monthly} for
# scripts to be executed. The info about last run is stored in
# /var/spool/cron/lastrun
#
# concept similar to debian and redhat
#
# Changes:
# 1998 - Burchard Steinbild <bs@suse.de>, 1998
# initial version
# before 2001 - va@org.chemie.uni-frankfurt.de
# send an email with name of date-script instead of cron entry
# "Subject: cronjob@www - daily - FAILURE"
# (better one script for each date-sub-script)
# requires changes to /etc/crontab
# append > /dev/null 2>&1 to the line calling run-cons
# 2001-09-11
# updated to Suse 7.2 merged
# 2001-09-12
# changed FAILURE detection, until now all scripts with output
# had "failed", now only scripts with error status != 0
# have failed.
# 2001-09-13 - ro@suse.de
# merged with 7.3: call logger with exit value for scripts
# respect MAILTO as cron does
# use mktemp -d for all tmpfiles
# add variable to disable mail if all jobs returned 0
#
#
# Don't run jobs on laptops, that are AC-offline
#
if test -x /usr/bin/on_ac_power ; then
on_ac_power -q
if [ "$?" = "1" ]; then
exit 0
fi
fi
if [ -f /etc/sysconfig/cron ]; then
. /etc/sysconfig/cron
fi
BASENAME=`/usr/bin/basename $0`
LOGGER="/bin/logger -t $BASENAME[$$]"
export LC_TIME=POSIX
TMPDIR=`mktemp -d /tmp/run-crons.XXXXXX`
trap "rm -rf $TMPDIR" 0 1 2 3 13 15
# We will force to run cron.daily after 14 days, even
# if you set MAX_NOT_RUN in /etc/sysconfig/cron
# value is in minutes
MAX_NOT_RUN_FORCE="20160"
# Priority change for sub scripts.
# range: highest -20 ... 19 lowest prioriy
# default processes start in level 10
CRON_SCRIPT_NICE_VALUE=15
SPOOL=/var/spool/cron/lastrun
# CRON Result EMail is sent to
if test -z "$MAILTO" ; then
SEND_TO="root"
else
SEND_TO="$MAILTO"
fi
mkdir -p $SPOOL
#set verbose
## stage 1, search directories/scripts to run
RUN=""
for CRONDIR in /etc/cron.{hourly,daily,weekly,monthly} ; do
test -d $CRONDIR || continue
BASE=${CRONDIR##*/}
TIME_EXT=${BASE##cron.}
test -e $SPOOL/$BASE && {
case $BASE in
cron.hourly) TIME="-cmin +60 -or -cmin 60" ;;
cron.daily)
# if DAILY_TIME set, run only at a fixed time of day
if [ "$DAILY_TIME" != "" ] ; then
DAILY_TIME_NEW="`echo $DAILY_TIME | sed s,:,, | sed s,^0\*,, `"
test -z "$DAILY_TIME_NEW" && DAILY_TIME_NEW=0
if [ "$DAILY_TIME_NEW" -gt "2359" ] ; then
echo "wrong time format in /etc/sysconfig/cron DAILY_TIME, value is $DAILY_TIME" | logger
fi
NOW_H=`date +%H%M| sed s,^0\*,,`
test -z "$NOW_H" && NOW_H=0
if [ $DAILY_TIME_NEW -gt $(($NOW_H-15)) ] && [ $DAILY_TIME_NEW -le $NOW_H ]; then
TIME=""
else
# take care of MAX_NOT_RUN, default is 7 days
if [ "$MAX_NOT_RUN" != "0" ] ; then
TIME="-cmin +$((1440*$MAX_NOT_RUN)) -or -cmin $((1440*$MAX_NOT_RUN))"
else
TIME="-cmin +$MAX_NOT_RUN_FORCE -or -cmin $MAX_NOT_RUN_FORCE"
fi
fi
# run as usual
else
TIME="-cmin +1440 -or -cmin 1440"
fi ;;
cron.weekly) TIME="-cmin +10080 -or -cmin 10080" ;;
cron.monthly)
DAYOFMONTH=`date '+%d'`
DAYSLASTMONTH=`date -d "-$DAYOFMONTH days" '+%d'`
if [ $DAYOFMONTH -gt $DAYSLASTMONTH ] ; then
LASTMONTHSTR="-$DAYOFMONTH days"
else
LASTMONTHSTR="last month"
fi
NOW=`date +%s`
LASTMONTH=`date -d "$LASTMONTHSTR" +%s`
DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400`
TIME="-ctime +$DIFF"
;;
esac
# remove all lock files for scripts that are due to run
eval find $SPOOL/$BASE $TIME | \
xargs --no-run-if-empty rm
}
if test ! -e $SPOOL/$BASE ; then
# accept this dir, if it isn't empty
LIST=`find $CRONDIR ! -type d`
if [ ! -z "$LIST" ] ; then
RUN="${RUN} ${TIME_EXT}"
fi
fi
done
## STATUS communication variable between
# function run_scripts ()
# and loop-over-all-scripts
# set in run_scripts to FAILURE if this script failed!
# else it is empty
# because it is never reset to empty after the initialization
# it implements an OR like logic over all scripts
##
STATUS=""
# helper, run all scripts in one cron directory
function run_scripts (){
local CRONDIR=$1
local TIME_EXT=$2
local TEMP_MSG=$TMPDIR/run-crons.${TIME_EXT}.$$
rm -r $TMPDIR/run-crons.${TIME_EXT}.* >/dev/null 2>&1
# keep going when something fails
set +e
for SCRIPT in $CRONDIR/* ; do
test -d $SCRIPT && continue
case "$SCRIPT" in
.svn) continue ;;
*.rpm*) continue ;;
*.swap) continue ;;
*.bak) continue ;;
*.orig) continue ;;
\#*) continue ;;
*~) continue ;;
esac
/sbin/checkproc $SCRIPT && continue
if test -x $SCRIPT ; then
BASESCRIPT=`/usr/bin/basename $SCRIPT`
nice -n ${CRON_SCRIPT_NICE_VALUE} $SCRIPT >$TEMP_MSG 2>&1
local ERRNO=$?
if [ 0 -eq $ERRNO ] ; then
if [ "$SYSLOG_ON_NO_ERROR" = "yes" ]; then
echo "$BASESCRIPT: OK" | $LOGGER -p info
fi
else
echo "$BASESCRIPT returned $ERRNO" | $LOGGER -p warn
echo "SCRIPT: $BASESCRIPT exited with RETURNCODE = $ERRNO."
STATUS="FAILURE"
fi
# write some wrapper text around the original output
if [ -s "$TEMP_MSG" ] ; then
echo "SCRIPT: output (stdout && stderr) follows"
echo ""
cat $TEMP_MSG
echo -e "SCRIPT: $BASESCRIPT\n------- END OF OUTPUT"
echo ""
echo ""
fi
rm -f $TEMP_MSG > /dev/null 2>&1
else
echo "WARNING: $SCRIPT is not executable, script is ignored !"
fi
done
}
# stage 2:
# run all scripts and collect output into one mail
# for each TIME_EXT with a meaningfull subject.
#
if [ ! -z "${RUN}" ] ; then
for EXT in ${RUN} ; do
CRONDIR="/etc/cron."${EXT}
test -d $CRONDIR || continue
BASE=`/usr/bin/basename $CRONDIR`
TIME_EXT=${BASE##cron.}
STATUS=""
if test ! -e $SPOOL/$BASE ; then
CONTROL_MAIL=$TMPDIR/run-crons_mail.$$
JOB_OUTPUT=$TMPDIR/run-crons_output.$$
echo "running ${TIME_EXT} cronjob scripts" >> ${CONTROL_MAIL}
echo "" >> ${CONTROL_MAIL}
touch $SPOOL/$BASE
run_scripts ${CRONDIR} ${TIME_EXT} >> ${JOB_OUTPUT} 2>&1
TITLE="cronjob@$HOSTNAME - ${TIME_EXT}"
if [ -n "${STATUS}" ] ; then
TITLE="${TITLE} - ${STATUS}"
else
TITLE="${TITLE} - OK"
fi
if [ -n "${STATUS}" -o "$SEND_MAIL_ON_NO_ERROR" = "yes" ] ; then
cat ${CONTROL_MAIL} ${JOB_OUTPUT} | mail ${SEND_TO} -s "${TITLE}"
elif [ -s ${JOB_OUTPUT} -a "$SEND_OUTPUT_ON_NO_ERROR" = "yes" ] ; then
cat ${CONTROL_MAIL} ${JOB_OUTPUT} | mail ${SEND_TO} -s "${TITLE}"
fi
rm -f ${CONTROL_MAIL} ${JOB_OUTPUT}
fi
done
fi
#
# now make sure, we have no lastrun files dated to future
#
touch $SPOOL
NOW=`date -u +%s`
for i in `find $SPOOL -type f`
do
FILEDATE=`date -u -r $i +%s`
# allow for up to one hour in the future because of summer/wintertime
if [ $((FILEDATE - NOW)) -gt 3600 ]
then
rm $i
fi
done

8
sample.root Normal file
View File

@ -0,0 +1,8 @@
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root
#
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1