From dd0067027dc58752a502d1304eb67beca84eae07 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 28 Mar 2009 17:44:07 +0100 Subject: [PATCH] cronie: add rc.d script and some config files. --HG-- extra : convert_revision : 5ddf685027b96d674702810d45cada1c04701828 --- templates/cronie/files/crond | 16 ++++++++++++++++ templates/cronie/files/crontab | 10 ++++++++++ templates/cronie/files/makewhatis.cron | 14 ++++++++++++++ templates/cronie/files/mlocate.cron | 5 +++++ templates/cronie/template | 22 ++++++++++++++++++++-- 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 templates/cronie/files/crond create mode 100644 templates/cronie/files/crontab create mode 100644 templates/cronie/files/makewhatis.cron create mode 100644 templates/cronie/files/mlocate.cron diff --git a/templates/cronie/files/crond b/templates/cronie/files/crond new file mode 100644 index 0000000000..c844568e00 --- /dev/null +++ b/templates/cronie/files/crond @@ -0,0 +1,16 @@ +#!/bin/sh +# + +# PROVIDE: crond +# REQUIRE: LOGIN +# KEYWORD: shutdown + +$_rc_subr_loaded . /etc/rc.subr + +name="crond" +rcvar=$name +command="/usr/sbin/${name}" +pidfile="/var/run/${name}.pid" + +load_rc_config $name +run_rc_command "$1" diff --git a/templates/cronie/files/crontab b/templates/cronie/files/crontab new file mode 100644 index 0000000000..8aa29e2a67 --- /dev/null +++ b/templates/cronie/files/crontab @@ -0,0 +1,10 @@ +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO= +HOME=/ + +# run-parts +01 * * * * root run-parts /etc/cron.hourly +02 4 * * * root run-parts /etc/cron.daily +22 4 * * 0 root run-parts /etc/cron.weekly +42 4 1 * * root run-parts /etc/cron.monthly diff --git a/templates/cronie/files/makewhatis.cron b/templates/cronie/files/makewhatis.cron new file mode 100644 index 0000000000..897e35f1ea --- /dev/null +++ b/templates/cronie/files/makewhatis.cron @@ -0,0 +1,14 @@ +#!/bin/sh + +LOCKFILE=/var/lock/makewhatis.lock + +# the lockfile is not meant to be perfect, it's just in case the +# two makewhatis cron scripts get run close to each other to keep +# them from stepping on each other's toes. The worst that will +# happen is that they will temporarily corrupt the database... +[ -f $LOCKFILE ] && exit 0 + +trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT +touch $LOCKFILE +makewhatis -u -w +exit 0 diff --git a/templates/cronie/files/mlocate.cron b/templates/cronie/files/mlocate.cron new file mode 100644 index 0000000000..6a338e110f --- /dev/null +++ b/templates/cronie/files/mlocate.cron @@ -0,0 +1,5 @@ +#!/bin/sh +nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }') +renice +19 -p $$ >/dev/null 2>&1 +ionice -c2 -n7 -p $$ >/dev/null 2>&1 +/usr/bin/updatedb -f "$nodevs" diff --git a/templates/cronie/template b/templates/cronie/template index ad5752869f..9da2452686 100644 --- a/templates/cronie/template +++ b/templates/cronie/template @@ -3,8 +3,8 @@ pkgname=cronie version=1.2 distfiles="http://mmaslano.fedorapeople.org/cronie/cronie-$version.tar.gz" build_style=gnu_configure -configure_args="--with-inotify --with-daemon_username=crond - --with-daemon_groupname=crond --without-selinux --with-pam" +configure_args="--with-inotify --without-selinux --with-pam + --with-daemon_username=nobody --with-daemon_groupname=nobody" short_desc="Runs specified programs at scheduled times" maintainer="Juan RP " checksum=261280d0143f39643c1e4c6e1fcffc875c35ca6690e20dac99ef5da93ea9616e @@ -14,5 +14,23 @@ long_desc=" has security and configuration enhancements like the ability to use PAM and SELinux." +conf_files="/etc/crontab" + Add_dependency full glibc Add_dependency full pam + +post_install() +{ + install -d ${DESTDIR}/etc/cron.d + install -d ${DESTDIR}/etc/cron.hourly + install -d ${DESTDIR}/etc/cron.daily + install -d ${DESTDIR}/etc/cron.weekly + install -d ${DESTDIR}/etc/cron.monthly + install -d -m700 ${DESTDIR}/var/spool/cron + + install -D -m755 ${FILESDIR}/crond ${DESTDIR}/etc/rc.d/crond + install -D -m644 ${FILESDIR}/crontab ${DESTDIR}/etc/crontab + + install -m755 ${FILESDIR}/mlocate.cron ${DESTDIR}/etc/cron.daily + install -m755 ${FILESDIR}/makewhatis.cron ${DESTDIR}/etc/cron.daily +}