diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/dcron/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/dcron/files')
-rw-r--r-- | sys-process/dcron/files/crontab | 15 | ||||
-rw-r--r-- | sys-process/dcron/files/dcron-4.5-ldflags.patch | 38 | ||||
-rw-r--r-- | sys-process/dcron/files/dcron-4.5-pidfile.patch | 43 | ||||
-rw-r--r-- | sys-process/dcron/files/dcron.confd | 5 | ||||
-rwxr-xr-x | sys-process/dcron/files/dcron.init | 23 | ||||
-rw-r--r-- | sys-process/dcron/files/dcron.service | 11 |
6 files changed, 135 insertions, 0 deletions
diff --git a/sys-process/dcron/files/crontab b/sys-process/dcron/files/crontab new file mode 100644 index 000000000000..8772cc49d36a --- /dev/null +++ b/sys-process/dcron/files/crontab @@ -0,0 +1,15 @@ +# for dcron + +# dcron: +# This is NOT the system crontab! dcron does not support a system crontab. +# to get /etc/cron.{hourly|daily|weekly|montly} working with dcron run +# crontab /etc/crontab +# as root. +# NOTE: This will REPLACE root's current crontab!! + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +59 * * * * rm -f /var/spool/cron/lastrun/cron.hourly +9 3 * * * rm -f /var/spool/cron/lastrun/cron.daily +19 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly +29 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly +*/10 * * * * test -x /usr/sbin/run-crons && /usr/sbin/run-crons diff --git a/sys-process/dcron/files/dcron-4.5-ldflags.patch b/sys-process/dcron/files/dcron-4.5-ldflags.patch new file mode 100644 index 000000000000..7fa2d8d9d015 --- /dev/null +++ b/sys-process/dcron/files/dcron-4.5-ldflags.patch @@ -0,0 +1,38 @@ +From 8a292168e584c50808b80df3577a7d89fa32db26 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 16 May 2011 16:24:20 -0400 +Subject: [PATCH] drop LDFLAGS set, and restore CFLAGS linking + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +--- + Makefile | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 1938e05..8309ad6 100644 +--- a/Makefile ++++ b/Makefile +@@ -32,7 +32,6 @@ TABSRCS = crontab.c chuser.c + TABOBJS = crontab.o chuser.o + PROTOS = protos.h + LIBS = +-LDFLAGS = + DEFS = -DVERSION='"$(VERSION)"' \ + -DSCRONTABS='"$(SCRONTABS)"' -DCRONTABS='"$(CRONTABS)"' \ + -DCRONSTAMPS='"$(CRONSTAMPS)"' -DLOG_IDENT='"$(LOG_IDENT)"' \ +@@ -54,10 +53,10 @@ protos.h: $(SRCS) $(TABSRCS) + fgrep -h Prototype $(SRCS) $(TABSRCS) > protos.h + + crond: $(OBJS) +- $(CC) $(LDFLAGS) $^ $(LIBS) -o crond ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o crond + + crontab: $(TABOBJS) +- $(CC) $(LDFLAGS) $^ -o crontab ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o crontab + + %.o: %.c defs.h $(PROTOS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@ +-- +1.7.5.rc3 + diff --git a/sys-process/dcron/files/dcron-4.5-pidfile.patch b/sys-process/dcron/files/dcron-4.5-pidfile.patch new file mode 100644 index 000000000000..6004c4c4b4d2 --- /dev/null +++ b/sys-process/dcron/files/dcron-4.5-pidfile.patch @@ -0,0 +1,43 @@ +From 14b0f33ebf33d3d08427fd4d9fd4bda3cc107bd0 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Tue, 26 Oct 2010 01:42:32 -0400 +Subject: [PATCH] crond: write a pid file + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +--- + Makefile | 2 +- + main.c | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/Makefile b/Makefile +index dc5b78f..e278312 100644 +--- a/Makefile ++++ b/Makefile +@@ -38,7 +38,7 @@ DEFS = -DVERSION='"$(VERSION)"' \ + -DTIMESTAMP_FMT='"$(TIMESTAMP_FMT)"' + + # save variables needed for `make install` in config +-all: $(PROTOS) crond crontab ; ++all: crond crontab ; + rm -f config + echo "PREFIX = $(PREFIX)" >> config + echo "SBINDIR = $(SBINDIR)" >> config +diff --git a/main.c b/main.c +index e4a742e..6313213 100644 +--- a/main.c ++++ b/main.c +@@ -227,6 +227,11 @@ main(int ac, char **av) + exit(1); + } else if (pid > 0) { + /* parent */ ++ FILE *fp; ++ if ((fp = fopen("/var/run/crond.pid", "w")) != NULL) { ++ fprintf(fp, "%d\n", pid); ++ fclose(fp); ++ } + exit(0); + } + /* child continues */ +-- +1.7.3.1 + diff --git a/sys-process/dcron/files/dcron.confd b/sys-process/dcron/files/dcron.confd new file mode 100644 index 000000000000..61cdf12b43a7 --- /dev/null +++ b/sys-process/dcron/files/dcron.confd @@ -0,0 +1,5 @@ +# /etc/conf.d/dcron + +# Options to pass to dcron at startup. +# Default logging is via syslog; use -L to send to file. +DCRON_OPTS="" diff --git a/sys-process/dcron/files/dcron.init b/sys-process/dcron/files/dcron.init new file mode 100755 index 000000000000..eccff493b369 --- /dev/null +++ b/sys-process/dcron/files/dcron.init @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use logger clock hostname + provide cron +} + +start() { + ebegin "Starting ${SVCNAME}" + /usr/sbin/crond ${DCRON_OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet \ + --pidfile /var/run/crond.pid --exec /usr/sbin/crond + local ret=$? + rm -f /var/run/crond.pid + eend ${ret} +} diff --git a/sys-process/dcron/files/dcron.service b/sys-process/dcron/files/dcron.service new file mode 100644 index 000000000000..0332390f2c81 --- /dev/null +++ b/sys-process/dcron/files/dcron.service @@ -0,0 +1,11 @@ +[Unit] +Description=Cron Daemon +After=syslog.target + +[Service] +ExecStart=/usr/sbin/crond -S -l info +Type=forking + +[Install] +WantedBy=multi-user.target + |