From 6d908a38e05b9d4135c65d23114a5874215b5bb8 Mon Sep 17 00:00:00 2001 From: Lukc Date: Sat, 11 Dec 2010 19:15:23 +0100 Subject: Engagement initial. --- dcron/.footprint | 27 +++++++++++++++++++++++++++ dcron/.md5sum | 5 +++++ dcron/Pkgfile | 22 ++++++++++++++++++++++ dcron/Pkgfile.old | 25 +++++++++++++++++++++++++ dcron/crond | 23 +++++++++++++++++++++++ dcron/crontab | 10 ++++++++++ dcron/dcron.diff | 22 ++++++++++++++++++++++ dcron/runjobs | 19 +++++++++++++++++++ 8 files changed, 153 insertions(+) create mode 100644 dcron/.footprint create mode 100644 dcron/.md5sum create mode 100644 dcron/Pkgfile create mode 100644 dcron/Pkgfile.old create mode 100755 dcron/crond create mode 100644 dcron/crontab create mode 100644 dcron/dcron.diff create mode 100755 dcron/runjobs (limited to 'dcron') diff --git a/dcron/.footprint b/dcron/.footprint new file mode 100644 index 0000000..78b7a40 --- /dev/null +++ b/dcron/.footprint @@ -0,0 +1,27 @@ +drwxr-xr-x root/root etc/ +drwxr-xr-x root/root etc/cron.d/ +drwxr-xr-x root/root etc/cron/ +drwxr-xr-x root/root etc/cron/daily/ +drwxr-xr-x root/root etc/cron/hourly/ +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-x--- root/users 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/ +-rwx------ 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/spool/ +drwxr-xr-x root/root var/spool/cron/ +drwxr-xr-x root/root var/spool/cron/cronstamps/ +drwxr-xr-x 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 0000000..3ca009e --- /dev/null +++ b/dcron/.md5sum @@ -0,0 +1,5 @@ +59a2ec9d1fe95f2a8b16814c2efbb8e7 crond +3596a4fa9cf63bdf130fd533ca7703d4 crontab +02d848ba043a9df5bf2102a9f4bc04bd dcron-4.4.tar.gz +384d0dbf3523058338ad2103114f8adc dcron.diff +d80b27b1b9532890136c14d30e2a0d2b runjobs diff --git a/dcron/Pkgfile b/dcron/Pkgfile new file mode 100644 index 0000000..fa1fb10 --- /dev/null +++ b/dcron/Pkgfile @@ -0,0 +1,22 @@ +description="Multi-user cron daemon" +packager="" +maintainer="CRUX System Team, core-ports at crux dot nu" +url="http://www.jimpryor.net/linux/dcron.html" +depends=() + +name=dcron +version=4.4 +release=2 +source=(http://www.jimpryor.net/linux/releases/dcron-4.4.tar.gz dcron.diff crontab runjobs crond) +build () +{ + cd $name-$version; + patch -p1 -i $SRC/dcron.diff; + make PREFIX=/usr; + make DESTDIR=$PKG MANDIR=/usr/man CRONTAB_GROUP=users install; + install -m 600 $SRC/crontab $PKG/var/spool/cron/crontabs/root; + ln -s ../var/spool/cron/crontabs/root $PKG/etc/crontab; + install -D -m 755 $SRC/crond $PKG/etc/rc.d/crond; + install -D -m 755 $SRC/runjobs $PKG/usr/sbin/runjobs; + install -d $PKG/etc/cron/{hourly,daily,weekly,monthly} +} diff --git a/dcron/Pkgfile.old b/dcron/Pkgfile.old new file mode 100644 index 0000000..26e2433 --- /dev/null +++ b/dcron/Pkgfile.old @@ -0,0 +1,25 @@ +# Description: Multi-user cron daemon +# URL: http://www.jimpryor.net/linux/dcron.html +# Maintainer: CRUX System Team, core-ports at crux dot nu + +name=dcron +version=4.4 +release=2 +source=(http://www.jimpryor.net/linux/releases/$name-$version.tar.gz \ + dcron.diff crontab runjobs crond) + +build() { + cd $name-$version + + patch -p1 -i $SRC/dcron.diff + + make PREFIX=/usr + make DESTDIR=$PKG MANDIR=/usr/man CRONTAB_GROUP=users install + + install -m 600 $SRC/crontab $PKG/var/spool/cron/crontabs/root + ln -s ../var/spool/cron/crontabs/root $PKG/etc/crontab + install -D -m 755 $SRC/crond $PKG/etc/rc.d/crond + install -D -m 755 $SRC/runjobs $PKG/usr/sbin/runjobs + + install -d $PKG/etc/cron/{hourly,daily,weekly,monthly} +} diff --git a/dcron/crond b/dcron/crond new file mode 100755 index 0000000..732889c --- /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 -S -l info + ;; +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 0000000..6cf0d18 --- /dev/null +++ b/dcron/crontab @@ -0,0 +1,10 @@ +# +# /etc/crontab: crond(8) configuration +# + +@hourly ID=sys.hourly /usr/sbin/runjobs /etc/cron/hourly +@daily ID=sys.daily /usr/sbin/runjobs /etc/cron/daily +@weekly ID=sys.weekly /usr/sbin/runjobs /etc/cron/weekly +@monthly ID=sys.monthly /usr/sbin/runjobs /etc/cron/monthly + +# End of file diff --git a/dcron/dcron.diff b/dcron/dcron.diff new file mode 100644 index 0000000..a37adbd --- /dev/null +++ b/dcron/dcron.diff @@ -0,0 +1,22 @@ +diff --git a/database.c b/database.c +--- a/database.c ++++ b/database.c +@@ -410,6 +410,7 @@ SynchronizeFile(const char *dpath, const char *fileName, const char *userName) + break; + case 5: + line.cl_Freq = MONTHLY_FREQ; ++ break; + case 6: + line.cl_Freq = YEARLY_FREQ; + /* else line.cl_Freq will remain 0 */ +diff --git a/database.c b/database.c +--- a/database.c ++++ b/database.c +@@ -258,6 +258,7 @@ ReadTimestamps(const char *user) + if (ptr && (*ptr == 0 || *ptr == '\n')) + /* strptime uses current seconds when seconds not specified? anyway, we don't get round minutes */ + tm.tm_sec = 0; ++ tm.tm_isdst = -1; + sec = mktime(&tm); + if (sec == (time_t)-1) { + printlogf(LOG_ERR, "failed parsing timestamp for user %s job %s\n", file->cf_UserName, line->cl_JobName); diff --git a/dcron/runjobs b/dcron/runjobs new file mode 100755 index 0000000..b61789e --- /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 " + 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 -- cgit v1.2.3-70-g09d2