diff options
author | B. Watson <urchlay@slackware.uk> | 2023-08-08 03:56:51 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-08-12 08:29:52 +0700 |
commit | dbd163adc6ec7d3065f2479e79a6e5c9857781a5 (patch) | |
tree | e33e5f7e9c3aef5af5a2fe0844c19a128f3f5aef /system/cronie | |
parent | a9bfc2f55bb287b96b29bb521cdd0ef3325d4170 (diff) |
system/cronie: Updated for version 1.6.1, new maintainer.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/cronie')
-rw-r--r-- | system/cronie/README | 12 | ||||
-rw-r--r-- | system/cronie/add-l-option.diff | 52 | ||||
-rw-r--r-- | system/cronie/crond.default | 9 | ||||
-rw-r--r-- | system/cronie/cronie.SlackBuild | 65 | ||||
-rw-r--r-- | system/cronie/cronie.info | 10 | ||||
-rw-r--r-- | system/cronie/doinst.sh | 13 | ||||
-rwxr-xr-x | system/cronie/rc.crond | 40 |
7 files changed, 161 insertions, 40 deletions
diff --git a/system/cronie/README b/system/cronie/README index 20ac09d3f6fa3..03d2489e8fc1c 100644 --- a/system/cronie/README +++ b/system/cronie/README @@ -1,3 +1,5 @@ +cronie (The standard UNIX cron daemon) + Cronie contains the standard UNIX daemon crond that runs specified programs at scheduled times and related tools. It is based on the original cron and has security and configuration enhancements like the @@ -11,14 +13,6 @@ conflict with dcron, so it is advised to remove dcron before installing cronie: Stop the dcron daemon and remove the dcron package: - # kill $(pgrep crond) + # /etc/rc.d/rc.crond stop # removepkg dcron # rm -rf /var/spool/cron - -Slackware's boot script assumes that you have dcron and thus has to be -modified: - -Change this line in /etc/rc.d/rc.M - /usr/sbin/crond -l notice -to: - /usr/sbin/crond diff --git a/system/cronie/add-l-option.diff b/system/cronie/add-l-option.diff new file mode 100644 index 0000000000000..c4c9b83fb4662 --- /dev/null +++ b/system/cronie/add-l-option.diff @@ -0,0 +1,52 @@ +diff -Naur cronie-1.6.1/man/cron.8 cronie-1.6.1.patched/man/cron.8 +--- cronie-1.6.1/man/cron.8 2022-03-22 09:42:22.000000000 -0400 ++++ cronie-1.6.1.patched/man/cron.8 2023-08-08 01:55:44.680979225 -0400 +@@ -22,7 +22,7 @@ + .\" + .\" $Id: cron.8,v 1.8 2004/01/23 19:03:32 vixie Exp $ + .\" +-.TH CRON "8" "2013-09-26" "cronie" "System Administration" ++.TH CRON "8" "2023-08-08" "cronie" "System Administration" + .SH NAME + crond \- daemon to execute scheduled commands + .SH SYNOPSIS +@@ -197,6 +197,9 @@ + .TP + .B "\-V" + Print version and exit. ++.TP ++.B "\-l" <level> ++Ignored. Option added for compatibility with dcron. + .SH SIGNALS + When the + .I SIGHUP +diff -Naur cronie-1.6.1/src/cron.c cronie-1.6.1.patched/src/cron.c +--- cronie-1.6.1/src/cron.c 2022-03-22 09:42:22.000000000 -0400 ++++ cronie-1.6.1.patched/src/cron.c 2023-08-08 01:52:41.016996510 -0400 +@@ -190,6 +190,7 @@ + fprintf(stderr, " -s log into syslog instead of sending mails\n"); + fprintf(stderr, " -V print version and exit\n"); + fprintf(stderr, " -x <flag> print debug information\n"); ++ fprintf(stderr, " -l <arg> ignored, for dcron compatibility\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "Debugging flags are: "); + for (dflags = DebugFlagNames; *dflags; dflags++) +@@ -691,7 +692,7 @@ + static void parse_args(int argc, char *argv[]) { + int argch; + +- while (-1 != (argch = getopt(argc, argv, "hnfpsiPx:m:cV"))) { ++ while (-1 != (argch = getopt(argc, argv, "hnfpsiPx:m:cVl:"))) { + switch (argch) { + case 'x': + if (!set_debug_flags(optarg)) +@@ -722,6 +723,9 @@ + case 'V': + puts(PACKAGE_STRING); + exit(EXIT_SUCCESS); ++ case 'l': ++ /* do nothing (ignore -l <whatever>) */ ++ break; + case 'h': + default: + usage(); diff --git a/system/cronie/crond.default b/system/cronie/crond.default new file mode 100644 index 0000000000000..e7eeaac12ba05 --- /dev/null +++ b/system/cronie/crond.default @@ -0,0 +1,9 @@ +# /etc/default/crond from SlackBuilds.org cronie package. +# The default Slackware version of this file has this: +#CROND_OPTS="-l notice" +# ...which doesn't do anything in cronie's crond, though it's +# been patched to accept (and ignore) the -l option so it can +# work with dcron's leftover config file. + +# Default is, no options at all: +CROND_OPTS="" diff --git a/system/cronie/cronie.SlackBuild b/system/cronie/cronie.SlackBuild index 21df14cb5ea2f..c3a4e245b4db9 100644 --- a/system/cronie/cronie.SlackBuild +++ b/system/cronie/cronie.SlackBuild @@ -2,9 +2,10 @@ # Slackware build script for cronie # Copyright 2012, 2013 Chris Abela, Malta -# Copyright 2014 Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org -# Copyright 2017-2018 Aaditya Bagga <aaditya_gnulinux@zoho.com> -# Copyright 2019 Ricardo J. Barberis <ricardo.barberis@gmail.com> +# Copyright 2014 Ryan P.C. McQuen | Everett, WA +# Copyright 2017-2018 Aaditya Bagga +# Copyright 2019 Ricardo J. Barberis +# Copyright 2023 B. Watson # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,10 +25,21 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20230808 bkw: +# - take over maintenance. +# - update for v1.6.1. +# - update README for modern Slackware. +# - remove useless INSTALL from doc dir. +# - add contrib/* to doc dir. +# - patch crond so it accepts (and ignores) "-l notice", so we don't have +# to change Slackware's init stuff. +# - add /etc/rc.d/rc.crond and /etc/default/crond. +# - gzip run-parts man page. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=cronie -VERSION=${VERSION:-1.5.4} +VERSION=${VERSION:-1.6.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +52,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -75,11 +84,14 @@ rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# 20230808 bkw: add the -l <level> option to crond, to allow Slackware's +# /etc/default/crond to work without being modified. this doesn't actually +# support changing the loglevel; it just makes crond accept and ignore +# the option. +patch -p1 < $CWD/add-l-option.diff # Enable anacron by default [ "$ANACRON" = no ] && unset ANACRONFLAG || ANACRONFLAG="--enable-anacron" @@ -97,10 +109,8 @@ CXXFLAGS="$SLKCFLAGS" \ "$ANACRONFLAG" make -make install DESTDIR=$PKG - -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +make install-strip DESTDIR=$PKG +gzip -9 $PKG/usr/man/man*/* mkdir -p $PKG/etc/cron.d # The absence of this directory would be logged @@ -112,21 +122,24 @@ chmod 600 $PKG/etc/cron.deny.new # These are copied from Slackware's dcron.SlackBuild cat $CWD/run-parts > $PKG/usr/bin/run-parts chmod 0755 $PKG/usr/bin/run-parts -cat $CWD/run-parts.8 > $PKG/usr/man/man8/run-parts.8 +gzip -9c < $CWD/run-parts.8 > $PKG/usr/man/man8/run-parts.8.gz mkdir -p $PKG/etc/cron.{hourly,daily,weekly,monthly} mkdir -p $PKG/var/spool/cron/ chmod 0700 $PKG/var/spool/cron/ cat $CWD/crontab.root > $PKG/var/spool/cron/root.new chmod 0600 $PKG/var/spool/cron/root.new - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - AUTHORS COPYING ChangeLog INSTALL NEWS README \ - $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +mkdir -p $PKG/etc/default $PKG/etc/rc.d +cat $CWD/crond.default > $PKG/etc/default/crond.new # modified from Slackware +cat $CWD/rc.crond > $PKG/etc/rc.d/rc.crond.new + +# default permissions are +x for the init script, though doinst.sh +# can change them. +chmod 755 $PKG/etc/rc.d/rc.crond.new + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a AUTHORS COPYING* ChangeLog NEWS README* contrib $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/system/cronie/cronie.info b/system/cronie/cronie.info index e8710de36713c..90cf34afc4862 100644 --- a/system/cronie/cronie.info +++ b/system/cronie/cronie.info @@ -1,10 +1,10 @@ PRGNAM="cronie" -VERSION="1.5.4" +VERSION="1.6.1" HOMEPAGE="https://github.com/cronie-crond/cronie" -DOWNLOAD="https://github.com/cronie-crond/cronie/releases/download/cronie-1.5.4-final/cronie-1.5.4.tar.gz" -MD5SUM="20233b96997e17a142e1fbe0d7ce8223" +DOWNLOAD="https://github.com/cronie-crond/cronie/releases/download/cronie-1.6.1/cronie-1.6.1.tar.gz" +MD5SUM="de07b7229520bc859d987c721bab87c5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="%README%" -MAINTAINER="Ricardo J. Barberis" -EMAIL="ricardo.barberis@gmail.com" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/cronie/doinst.sh b/system/cronie/doinst.sh index b3d680f840712..9edca555ec365 100644 --- a/system/cronie/doinst.sh +++ b/system/cronie/doinst.sh @@ -8,5 +8,18 @@ config() { fi } +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + config var/spool/cron/root.new config etc/cron.deny.new +config etc/default/crond.new +preserve_perms etc/rc.d/rc.crond.new diff --git a/system/cronie/rc.crond b/system/cronie/rc.crond new file mode 100755 index 0000000000000..d9076b330b8d0 --- /dev/null +++ b/system/cronie/rc.crond @@ -0,0 +1,40 @@ +#!/bin/sh +# /etc/rc.d/rc.crond - start/stop the cron daemon + +# To change the default options, edit /etc/default/crond. +if [ -r /etc/default/crond ]; then + . /etc/default/crond +fi + +start_crond() { + if ! /usr/bin/pgrep --ns $$ --euid root -f "^/usr/sbin/crond" 1> /dev/null 2> /dev/null ; then + echo "Starting crond: /usr/sbin/crond $CROND_OPTS" + mkdir -p /run/cron + /usr/sbin/crond $CROND_OPTS + fi +} + +stop_crond() { + echo "Stopping crond." + /usr/bin/pkill --ns $$ --euid root -f "^/usr/sbin/crond" 2> /dev/null +} + +restart_crond() { + stop_crond + sleep 1 + start_crond +} + +case "$1" in +'start') + start_crond + ;; +'stop') + stop_crond + ;; +'restart') + restart_crond + ;; +*) + echo "usage $0 start|stop|restart" +esac |