summaryrefslogtreecommitdiff
path: root/dcron
diff options
context:
space:
mode:
authorJohannes Winkelmann <jw@smts.ch>2006-02-23 15:26:10 +0000
committerJohannes Winkelmann <jw@smts.ch>2006-02-23 15:26:10 +0000
commite3afe2298e821d7f5860128720e665d8fb3bd641 (patch)
treebfb499432688352b1140b13ad8252c8e4e739006 /dcron
downloadcore-e3afe2298e821d7f5860128720e665d8fb3bd641.tar.gz
core-e3afe2298e821d7f5860128720e665d8fb3bd641.tar.xz
create branch for 2.2
Diffstat (limited to 'dcron')
-rw-r--r--dcron/.footprint26
-rw-r--r--dcron/.md5sum5
-rw-r--r--dcron/Pkgfile23
-rwxr-xr-xdcron/crond23
-rw-r--r--dcron/crontab11
-rw-r--r--dcron/dcron-2.3.3.patch91
-rwxr-xr-xdcron/runjobs19
7 files changed, 198 insertions, 0 deletions
diff --git a/dcron/.footprint b/dcron/.footprint
new file mode 100644
index 00000000..2cb49fe0
--- /dev/null
+++ b/dcron/.footprint
@@ -0,0 +1,26 @@
+drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/cron/
+drwxr-xr-x root/root etc/cron/daily/
+drwxr-xr-x root/root etc/cron/monthly/
+drwxr-xr-x root/root etc/cron/weekly/
+lrwxrwxrwx root/root etc/crontab -> ../var/spool/cron/crontabs/root
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-xr-x root/root etc/rc.d/crond
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwsr-xr-x root/root usr/bin/crontab
+drwxr-xr-x root/root usr/man/
+drwxr-xr-x root/root usr/man/man1/
+-rw-r--r-- root/root usr/man/man1/crontab.1.gz
+drwxr-xr-x root/root usr/man/man8/
+-rw-r--r-- root/root usr/man/man8/crond.8.gz
+drwxr-xr-x root/root usr/sbin/
+-rwxr-xr-x root/root usr/sbin/crond
+-rwxr-xr-x root/root usr/sbin/runjobs
+drwxr-xr-x root/root var/
+drwxr-xr-x root/root var/log/
+-rw-r--r-- root/root var/log/cron (EMPTY)
+drwxr-xr-x root/root var/spool/
+drwxr-xr-x root/root var/spool/cron/
+drwx------ root/root var/spool/cron/crontabs/
+-rw------- root/root var/spool/cron/crontabs/root
diff --git a/dcron/.md5sum b/dcron/.md5sum
new file mode 100644
index 00000000..fd5bee46
--- /dev/null
+++ b/dcron/.md5sum
@@ -0,0 +1,5 @@
+3540f192c0d50dbc566211ac7052f39e crond
+3e71eb70863bea6491bf4b3ac291a7b0 crontab
+d0d819a48773b4f3f9f2f8322ca64097 dcron-2.3.3.patch
+537cda2dff7dfaf87660fee91b2cf78f dcron-2.3.3.tar.gz
+d80b27b1b9532890136c14d30e2a0d2b runjobs
diff --git a/dcron/Pkgfile b/dcron/Pkgfile
new file mode 100644
index 00000000..79f9f747
--- /dev/null
+++ b/dcron/Pkgfile
@@ -0,0 +1,23 @@
+# Description: Multi-user cron daemon
+# URL: http://freshmeat.net/projects/dcron/
+# Maintainer: Per Lidén <per@fukt.bth.se>
+
+name=dcron
+version=2.3.3
+release=10
+source=(http://www.ibiblio.org/pub/linux/system/daemons/cron/$name-$version.tar.gz \
+ crontab runjobs crond $name-$version.patch)
+
+build() {
+ cd $name-$version
+ patch -p1 < ../$name-$version.patch
+ make
+ make DESTDIR=$PKG install
+ mkdir -p $PKG/var/{spool,log} $PKG/etc/cron/{daily,weekly,monthly}
+ install -D -m 600 ../crontab $PKG/var/spool/cron/crontabs/root
+ install -D -m 755 ../crond $PKG/etc/rc.d/crond
+ install -D -m 755 ../runjobs $PKG/usr/sbin/runjobs
+ chmod 0700 $PKG/var/spool/cron/crontabs
+ ln -s ../var/spool/cron/crontabs/root $PKG/etc/crontab
+ touch $PKG/var/log/cron
+}
diff --git a/dcron/crond b/dcron/crond
new file mode 100755
index 00000000..d5d75293
--- /dev/null
+++ b/dcron/crond
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# /etc/rc.d/crond: start/stop cron daemon
+#
+
+case $1 in
+start)
+ /usr/sbin/crond &> /var/log/cron
+ ;;
+stop)
+ killall -q /usr/sbin/crond
+ ;;
+restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+*)
+ echo "usage: $0 [start|stop|restart]"
+ ;;
+esac
+
+# End of file
diff --git a/dcron/crontab b/dcron/crontab
new file mode 100644
index 00000000..d2e760d9
--- /dev/null
+++ b/dcron/crontab
@@ -0,0 +1,11 @@
+#
+# /etc/crontab: crond(8) configuration
+#
+# The format of this file:
+# Min Hour Day Month DayOfWeek Command
+
+00 20 * * * /usr/sbin/runjobs /etc/cron/daily
+05 20 * * mon /usr/sbin/runjobs /etc/cron/weekly
+10 20 1 * * /usr/sbin/runjobs /etc/cron/monthly
+
+# End of file
diff --git a/dcron/dcron-2.3.3.patch b/dcron/dcron-2.3.3.patch
new file mode 100644
index 00000000..ff512f46
--- /dev/null
+++ b/dcron/dcron-2.3.3.patch
@@ -0,0 +1,91 @@
+diff -ru dcron-2.3.3/Makefile dcron-2.3.3-new/Makefile
+--- dcron-2.3.3/Makefile Fri Sep 5 21:42:44 1997
++++ dcron-2.3.3-new/Makefile Thu Aug 9 22:23:34 2001
+@@ -1,8 +1,9 @@
+ # Makefile for dillon's cron and crontab
+ #
+
++DESTDIR =
+ CC = gcc
+-CFLAGS = -O2 -Wall -Wstrict-prototypes
++CFLAGS += -Wall -Wstrict-prototypes
+ LIB =
+ SRCS = main.c subs.c database.c job.c
+ OBJS = main.o subs.o database.o job.o
+@@ -13,12 +14,10 @@
+ all: ${PROTOS} crond crontab
+
+ crond: ${OBJS}
+- ${CC} ${CFLAGS} -o crond ${OBJS} ${LIB}
+- strip crond
++ ${CC} ${CFLAGS} -o crond ${OBJS} ${LIB} ${LDFLAGS}
+
+ crontab: ${D_OBJS}
+- ${CC} ${CFLAGS} -o crontab ${D_OBJS}
+- strip crontab
++ ${CC} ${CFLAGS} -o crontab ${D_OBJS} ${LDFLAGS}
+
+ protos.h: ${SRCS} ${D_SRCS}
+ fgrep -h Prototype ${SRCS} ${D_SRCS} >protos.h
+@@ -30,10 +29,10 @@
+ rm -f *.o dcron.tgz $(PROTOS)
+
+ install: crond crontab
+- install -o root -g root -m 0755 crond /usr/sbin
+- install -o root -g root -m 4755 crontab /usr/bin
+- install -o root -g root crontab.1 /usr/man/man1
+- install -o root -g root crond.8 /usr/man/man8
++ install -o root -g root -m 0755 -D crond $(DESTDIR)/usr/sbin/crond
++ install -o root -g root -m 4755 -D crontab $(DESTDIR)/usr/bin/crontab
++ install -o root -g root -m 0644 -D crontab.1 $(DESTDIR)/usr/man/man1/crontab.1
++ install -o root -g root -m 0644 -D crond.8 $(DESTDIR)/usr/man/man8/crond.8
+
+ tar: cleano
+ (cd ..; tar cvf - dcron | gzip -9 >dcron.tgz.tmp)
+diff -ru dcron-2.3.3/defs.h dcron-2.3.3-new/defs.h
+--- dcron-2.3.3/defs.h Fri Sep 5 21:44:32 1997
++++ dcron-2.3.3-new/defs.h Thu Aug 9 22:23:53 2001
+@@ -35,7 +35,7 @@
+ #define OPEN_MAX 256
+ #endif
+ #ifndef SENDMAIL
+-#define SENDMAIL "/usr/lib/sendmail"
++#define SENDMAIL "/usr/sbin/sendmail"
+ #endif
+ #ifndef SENDMAIL_ARGS
+ #define SENDMAIL_ARGS "-t", "-oem", "-i"
+diff -ru dcron-2.3.3/subs.c dcron-2.3.3-new/subs.c
+--- dcron-2.3.3/subs.c Mon Feb 16 20:35:10 1998
++++ dcron-2.3.3-new/subs.c Thu Aug 9 22:23:34 2001
+@@ -15,7 +15,7 @@
+ Prototype int ChangeUser(const char *user, short dochdir);
+ Prototype void vlog(int level, int fd, const char *ctl, va_list va);
+ Prototype int slog(char *buf, size_t sz, const char *ctl, va_list va, short useDate);
+-Prototype char *strdup(const char *);
++/*Prototype char *strdup(const char *);*/
+
+ void
+ log9(const char *ctl, ...)
+@@ -80,7 +80,7 @@
+
+ buf[0] = 0;
+ if (useDate)
+- strftime(buf, 128, "%d-%b-%y %H:%M ", tp);
++ strftime(buf, 128, "%d-%b-%Y %H:%M ", tp);
+ vsnprintf(buf + strlen(buf), sz - strlen(buf), ctl, va);
+ return(strlen(buf));
+ }
+@@ -131,6 +131,7 @@
+ return(pas->pw_uid);
+ }
+
++/*
+ char *
+ strdup(const char *str)
+ {
+@@ -140,4 +141,4 @@
+ strcpy(ptr, str);
+ return(ptr);
+ }
+-
++*/
diff --git a/dcron/runjobs b/dcron/runjobs
new file mode 100755
index 00000000..b61789e6
--- /dev/null
+++ b/dcron/runjobs
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# /usr/sbin/runjobs: run all executables in specified directory
+#
+
+if [ "$1" = "" ]; then
+ echo "usage: $0 <dir>"
+ exit 1
+fi
+
+cd $1 || exit 1
+
+for file in ./*; do
+ if [ -f $file ] && [ -x $file ]; then
+ nice -n 19 $file
+ fi
+done
+
+# End of file

Generated by cgit