summaryrefslogtreecommitdiff
path: root/sys-process/fcron/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/fcron/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/fcron/files')
-rw-r--r--sys-process/fcron/files/crontab.226
-rw-r--r--sys-process/fcron/files/fcron-3.1.1-noreadline.patch14
-rw-r--r--sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch30
-rw-r--r--sys-process/fcron/files/fcron.confd7
-rw-r--r--sys-process/fcron/files/fcron.init-r5100
-rw-r--r--sys-process/fcron/files/fcron.init.498
-rw-r--r--sys-process/fcron/files/fcrontab.24
7 files changed, 279 insertions, 0 deletions
diff --git a/sys-process/fcron/files/crontab.2 b/sys-process/fcron/files/crontab.2
new file mode 100644
index 000000000000..4f2048f03de8
--- /dev/null
+++ b/sys-process/fcron/files/crontab.2
@@ -0,0 +1,26 @@
+# /etc/crontab:
+# This is fcron's special systab and *not* root's crontab!
+
+# Global variables
+SHELL=/bin/bash
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+HOME=/
+
+# "run-crons" from sys-process/cronbase package doesn't allow selective
+# runs like "run-parts" from sys-apps/debianutils. So every time
+# "run-crons" gets executed it loops through
+# /etc/cron.{hourly,daily,weekly,monthly} and executes one after another if
+# lastrun lock file isn't in place.
+# Without fcron's "serial(true)" option it would be possible that a lastrun
+# lock file which should have been removed still exists when "run-crons"
+# starts so that a promptly execution of all cronjobs isn't always
+# guaranteed.
+
+!serial(true)
+00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
+00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
+00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
+00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
+*/10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+!serial(false)
diff --git a/sys-process/fcron/files/fcron-3.1.1-noreadline.patch b/sys-process/fcron/files/fcron-3.1.1-noreadline.patch
new file mode 100644
index 000000000000..161e75b0998e
--- /dev/null
+++ b/sys-process/fcron/files/fcron-3.1.1-noreadline.patch
@@ -0,0 +1,14 @@
+Index: fcron-3.1.1/configure.in
+===================================================================
+--- fcron-3.1.1.orig/configure.in
++++ fcron-3.1.1/configure.in
+@@ -86,7 +86,8 @@ AC_FUNC_WAIT3
+ AC_CHECK_LIB(xnet, shutdown)
+ AC_CHECK_LIB(selinux, getcon, [selinuxavail=1], [selinuxavail=0])
+ AC_CHECK_LIB(audit, audit_open, [auditavail=1], [auditavail=0])
+-AX_LIB_READLINE
++AC_ARG_WITH([readline], AS_HELP_STRING([--without-readline], [Build without readline @<:@default=yes@:>@]))
++AS_IF([test "x$with_readline" != "xno"], [AX_LIB_READLINE], [ax_cv_lib_readline=no])
+ AC_CHECK_FUNC(getloadavg, [getloadavg=1], [getloadavg=0])
+ AC_CHECK_LIB(kstat, kstat_open, [kstat=1], [kstat=0])
+ if test $getloadavg -eq 1; then
diff --git a/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch b/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch
new file mode 100644
index 000000000000..b4166ff9d7e3
--- /dev/null
+++ b/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch
@@ -0,0 +1,30 @@
+From cc7a684862fee31c442c49d6a537d86979c23220 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Thu, 17 Nov 2016 17:19:35 +0100
+Subject: [PATCH] configure: Fix --with-audit parameter check
+
+Due to a missing "$" the variable "$useaudit" was never checked for
+0 value with the result that you cannot disable building against
+libaudit.
+
+Gentoo-Bug: https://bugs.gentoo.org/540446
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 7e7634f..708d1dd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -822,7 +822,7 @@ AC_ARG_WITH(audit,
+ ;;
+ esac ]
+ )
+-if test useaudit = "0"; then
++if test "$useaudit" = 0; then
+ AC_MSG_RESULT(no)
+ elif test "$useaudit" = "1" && test "$auditavail" != 1; then
+ useaudit=0
+--
+2.10.2
+
diff --git a/sys-process/fcron/files/fcron.confd b/sys-process/fcron/files/fcron.confd
new file mode 100644
index 000000000000..ea907d8e80b7
--- /dev/null
+++ b/sys-process/fcron/files/fcron.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/fcron
+
+# Options to fcron
+# See fcron(8) for more details
+# Notes:
+# * Do not specify another CONFIGFILE
+#FCRON_OPTS=""
diff --git a/sys-process/fcron/files/fcron.init-r5 b/sys-process/fcron/files/fcron.init-r5
new file mode 100644
index 000000000000..4021cb2fbb3e
--- /dev/null
+++ b/sys-process/fcron/files/fcron.init-r5
@@ -0,0 +1,100 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FCRON_INSTANCE="${SVCNAME##*.}"
+FCRON_OPTS=${FCRON_OPTS:-""}
+
+if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then
+ FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
+else
+ FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
+fi
+
+getconfig() {
+ local key="$1"
+ local value_default="$2"
+ local value=
+
+ if service_started; then
+ value="$(service_get_value "${key}")"
+ fi
+
+ if [ -z "${value}" ] && [ -r "${FCRON_CONFIGFILE}" ]; then
+ value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
+ fi
+
+ if [ -z "${value}" ]; then
+ # Value not explicitly set in the configfile or configfile does not exist
+ # or is not readable
+ echo "${value_default}"
+ else
+ echo "${value}"
+ fi
+
+ return 0
+}
+
+depend() {
+ config "${FCRON_CONFIGFILE}"
+
+ use clock logger
+ need hostname
+
+ # provide the cron service if we are the main instance
+ [ "${SVCNAME}" = "fcron" ] && provide cron
+}
+
+
+command="/usr/libexec/fcron"
+command_args="${FCRON_OPTS} -c \"${FCRON_CONFIGFILE}\""
+start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
+pidfile="$(getconfig pidfile /run/fcron.pid)"
+fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
+fifofile="$(getconfig fifofile /run/fcron.fifo)"
+required_files="${FCRON_CONFIGFILE}"
+
+extra_started_commands="reload"
+
+reload() {
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+}
+
+start_pre() {
+ if [ "${SVCNAME}" != "fcron" ]; then
+ local _has_invalid_instance_cfg=0
+
+ if [ "${pidfile}" = "/run/fcron.pid" ]; then
+ eerror "You cannot use the same pidfile like the default instance!"
+ eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
+ eerror "You cannot use the same fcrontabs location like the default instance!"
+ eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fifofile}" = "/run/fcron.fifo" ]; then
+ eerror "You cannot use the same fifo file like the default instance!"
+ eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
+ fi
+
+ checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
+
+ if [ ! -d "${fcrontabs}" ]; then
+ ebegin "Creating missing spooldir '${fcrontabs}'"
+ ${command} --newspooldir "${fcrontabs}"
+ eend $?
+ fi
+}
+
+start_post() {
+ service_set_value fcrontabs "${fcrontabs}"
+ service_set_value fifofile "${fifofile}"
+}
diff --git a/sys-process/fcron/files/fcron.init.4 b/sys-process/fcron/files/fcron.init.4
new file mode 100644
index 000000000000..e253e5bffcfe
--- /dev/null
+++ b/sys-process/fcron/files/fcron.init.4
@@ -0,0 +1,98 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FCRON_INSTANCE="${SVCNAME##*.}"
+
+if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then
+ FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
+else
+ FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
+fi
+
+getconfig() {
+ local key="$1"
+ local value_default="$2"
+ local value=
+
+ if service_started; then
+ value="$(service_get_value "${key}")"
+ fi
+
+ if [ -z "${value}" ] && [ -r "${FCRON_CONFIGFILE}" ]; then
+ value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
+ fi
+
+ if [ -z "${value}" ]; then
+ # Value not explicitly set in the configfile or configfile does not exist
+ # or is not readable
+ echo "${value_default}"
+ else
+ echo "${value}"
+ fi
+
+ return 0
+}
+
+depend() {
+ config "${FCRON_CONFIGFILE}"
+
+ use clock logger
+ need hostname
+
+ # provide the cron service if we are the main instance
+ [ "${SVCNAME}" = "fcron" ] && provide cron
+}
+
+command="/usr/libexec/fcron"
+command_args="-c \"${FCRON_CONFIGFILE}\""
+start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
+pidfile="$(getconfig pidfile /run/fcron.pid)"
+fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
+fifofile="$(getconfig fifofile /run/fcron.fifo)"
+required_files="${FCRON_CONFIGFILE}"
+
+extra_started_commands="reload"
+
+reload() {
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+}
+
+start_pre() {
+ if [ "${SVCNAME}" != "fcron" ]; then
+ local _has_invalid_instance_cfg=0
+
+ if [ "${pidfile}" = "/run/fcron.pid" ]; then
+ eerror "You cannot use the same pidfile like the default instance!"
+ eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
+ eerror "You cannot use the same fcrontabs location like the default instance!"
+ eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fifofile}" = "/run/fcron.fifo" ]; then
+ eerror "You cannot use the same fifo file like the default instance!"
+ eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
+ fi
+
+ checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
+
+ if [ ! -d "${fcrontabs}" ]; then
+ ebegin "Creating missing spooldir '${fcrontabs}'"
+ ${command} --newspooldir "${fcrontabs}"
+ eend $?
+ fi
+}
+
+start_post() {
+ service_set_value fcrontabs "${fcrontabs}"
+ service_set_value fifofile "${fifofile}"
+}
diff --git a/sys-process/fcron/files/fcrontab.2 b/sys-process/fcron/files/fcrontab.2
new file mode 100644
index 000000000000..e8c83b5fa3bf
--- /dev/null
+++ b/sys-process/fcron/files/fcrontab.2
@@ -0,0 +1,4 @@
+# Script for checking system crontabs and creating the fcron systab.
+# Runs every 10 minutes, does not mail output, doesn't log job runs
+# except for errors.
+@mail(false),nolog(true) 10 /usr/libexec/check_system_crontabs -s 0