diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..861fa06 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,16 @@ +cronie for Debian +----------------- + +This version of cronie has been patched and configured to be as compatible as +possible to Debian's standard job scheduler, ISC cron. You should be able to +switch between these implementations without experiencing any major negative +side effects to your system. + +Feature-wise, however, there still are quite a number of subtle and +not-so-subtle differences (mostly because of how much Debian's version of ISC +cron is patched), so be sure to read the manpages. + +cronie installs a file /etc/cron.deny (empty), thereby enabling all users to +use the crontab(1) command by default. + + -- Christian Kastner Sun, 20 Mar 2011 01:27:55 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5546e2c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,11 @@ +cronie (1.4.8-1~exp1) experimental; urgency=low + + * Initial release (Closes: #590876) + * debian/patches added: + - 0001-Unbundle-anacron + - 0002-Manpage-and-typo-fixes + - 0003-Rename-PAM-service-to-cronie + - 0004-Debian-specific-paths-and-features + - 0005-Extend-support-for-kFreeBSD-and-GNU-HURD + + -- Christian Kastner Tue, 26 Jul 2011 14:00:34 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..d923498 --- /dev/null +++ b/debian/control @@ -0,0 +1,41 @@ +Source: cronie +Section: admin +Priority: optional +Maintainer: Christian Kastner +Build-Depends: + debhelper (>= 7.2.3~), + dh-autoreconf, + libpam0g-dev, + libselinux1-dev [linux-any], + libaudit-dev [linux-any] +Standards-Version: 3.9.2 +Homepage: https://fedorahosted.org/cronie/ +Vcs-Git: git://scm.kvr.at/git/pkg-cronie.git +Vcs-Browser: http://scm.kvr.at/git/?p=pkg-cronie.git;a=summary + +Package: cronie +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + adduser, + lsb-base (>= 3.0-6), + libpam-runtime (>= 1.0.1-11) +Recommends: + exim4 | mail-transport-agent +Suggests: + anacron (>= 2.0-1) +Provides: cron-daemon, cron +Conflicts: cron +Replaces: cron +Description: Process Scheduling Daemon + cronie is a daemon that runs specified programs at scheduled times and + optionally mails generated output to the user. It is a fork of the original + ISC cron and contains many improvements, such as: + * inotify support (Linux only) + * clustering support + * full PAM support + . + cronie is fully compatible with ISC cron (Debian's standard job scheduler), + and can be used as a drop-in replacement for it. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5182fa0 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,134 @@ +Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=173 +Upstream-Name: cronie +Upstream-Contact: Marcela Mašláňová +Source: https://fedorahosted.org/releases/c/r/cronie/ + +Files: * +Copyright: 1988,1990,1993,1994, Paul Vixie + 1997,2000, Internet Software Consortium, Inc. + 2004, Internet Systems Consortium, Inc. ("ISC") + 1997-2011, Red Hat, Inc. + 2000,2002, Todd C. Miller + 2010, Colin Dean +License: ISC + +Files: popen.c +Copyright: 1989,1993,1994,2005, The Regents of the University of California +License: BSD-2-clause + +Files: bitstring.h +Copyright: 1989,1993,2003, The Regents of the University of California +License: BSD-3-clause + +Files: anacron/* +Copyright: 1998, Itai Tzur + 1999, Sean 'Shaleh' Perry + 2004, Pascal Hakim + 2009-2011, Red Hat, Inc. +License: GPL-2+ + +Files: debian/* + 2010-2011, Christian Kastner +License: GPL-3+ + +Files: debian/patches/* +Copyright: 2011, Christian Kastner +License: ISC + +License: ISC + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + "/usr/share/common-licenses/GPL-2". + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public + License version 3 can be found in the file + "/usr/share/common-licenses/GPL-3". + diff --git a/debian/cronie.default b/debian/cronie.default new file mode 100644 index 0000000..0702915 --- /dev/null +++ b/debian/cronie.default @@ -0,0 +1,12 @@ +# Defaults for cronie initscript +# This is a POSIX shell fragment + +# Some additional options for the daemon +# See cron(8) for all options and a detailed explanation of these +# +# -m shell command to use for sending mail instead of sendmail(8) +# -p lift some restrictions on user crontabs (owner, mode, type) +# -c enable clustering support +# -s send job output to syslog instead of mail +# +DAEMON_ARGS="" diff --git a/debian/cronie.deny b/debian/cronie.deny new file mode 100644 index 0000000..e69de29 diff --git a/debian/cronie.init b/debian/cronie.init new file mode 100644 index 0000000..b0ef62e --- /dev/null +++ b/debian/cronie.init @@ -0,0 +1,87 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: cronie +# Required-Start: $remote_fs $syslog $time +# Required-Stop: $remote_fs $syslog $time +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: time-based job scheduler +# Description: cronie is a daemon that runs specified programs at +# scheduled times and optionally mails generated output +# to the user. +### END INIT INFO + +# Author: Christian Kastner + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="time-based job scheduler" +NAME=cronie +DAEMON_NAME=crond +DAEMON=/usr/sbin/$DAEMON_NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$DAEMON_NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x $DAEMON ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +. /lib/lsb/init-functions + +do_start() +{ + start_daemon -p $PIDFILE $DAEMON $DAEMON_ARGS +} + +do_stop() +{ + killproc -p $PIDFILE $DAEMON +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;; + 2|3) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|3) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;; + *) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;; + esac + ;; + status) + status_of_proc -p $PIDFILE "$DAEMON" "$DAEMON_NAME" && exit 0 || exit $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + if [ $? -eq 0 ] + then + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + else + # Failed to stop + log_end_msg 1 + fi + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac diff --git a/debian/cronie.pam b/debian/cronie.pam new file mode 100644 index 0000000..5bdf04a --- /dev/null +++ b/debian/cronie.pam @@ -0,0 +1,21 @@ +# The PAM configuration file for cronie (cron daemon) + +# Access control using /etc/security/access.conf +account required pam_access.so + +# Set the loginuid process attribute +session required pam_loginuid.so + +# Read environment variables from pam_env's default files, /etc/environment +# and /etc/security/pam_env.conf. +session required pam_env.so + +# In addition to the above, read system locale information +session required pam_env.so envfile=/etc/default/locale + +# Sets up user limits +session required pam_limits.so + +@include common-account +@include common-session-noninteractive +@include common-auth diff --git a/debian/crontab.system b/debian/crontab.system new file mode 100644 index 0000000..872b8bb --- /dev/null +++ b/debian/crontab.system @@ -0,0 +1,12 @@ +# /etc/crontab: system-wide crontab +# See crontab(5) + +# Set PATH to system default +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +# m h dom mon dow user command +17 * * * * root cd / && run-parts --report /etc/cron.hourly +25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) +47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) +52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) +# diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..fbee0e7 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,6 @@ +etc/cron.d +etc/cron.hourly +etc/cron.daily +etc/cron.weekly +etc/cron.monthly +var/spool/cron/crontabs diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..50bd824 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +NEWS +README diff --git a/debian/patches/0001-Unbundle-anacron.patch b/debian/patches/0001-Unbundle-anacron.patch new file mode 100644 index 0000000..d6adaf5 --- /dev/null +++ b/debian/patches/0001-Unbundle-anacron.patch @@ -0,0 +1,54 @@ +From: Christian Kastner +Date: Thu, 28 Jul 2011 11:01:03 +0200 +Subject: Unbundle anacron + +Upstream has integrated anacron into cronie. Debian has its own package, so +we unbundle it (mostly by removing references to it). + +Forwarded: not-needed +Last-Update: 2011-07-28 +--- + man/cron.8 | 7 +++---- + man/crontab.5 | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/man/cron.8 b/man/cron.8 +index 8f36a51..36006ca 100644 +--- a/man/cron.8 ++++ b/man/cron.8 +@@ -49,8 +49,7 @@ for crontab files which are named after accounts in + The found crontabs are loaded into the memory. + .I Cron + also searches for +-.I /etc/anacrontab +-and any files in the ++any files in the + .I /etc/cron.d + directory, which have a different format (see + .BR crontab (5)). +@@ -82,9 +81,9 @@ crontables were modified. The modtime option is also used when inotify can not b + .PP + .I Cron + checks these files and directories: +-.IR /etc/anacrontab ++.IR /etc/crontab + system crontab, usually used to run daily, weekly, monthly jobs. See +-.BR anacrontab (5) ++.BR crontab (5) + for more details. + .IR /etc/cron.d/ + directory that contains system cronjobs stored for different users. +diff --git a/man/crontab.5 b/man/crontab.5 +index 0132fc7..6853b73 100644 +--- a/man/crontab.5 ++++ b/man/crontab.5 +@@ -274,7 +274,7 @@ MLS_LEVEL=SystemHigh + 0-59 * * * * id -Z > /tmp/SystemHigh/crontest + .fi + .SH FILES +-.I /etc/anacrontab ++.I /etc/crontab + system crontab file for jobs like cron.daily, weekly, monthly. + .I /var/spool/cron/ + a directory for storing crontabs defined by users. +-- diff --git a/debian/patches/0002-Manpage-and-typo-fixes.patch b/debian/patches/0002-Manpage-and-typo-fixes.patch new file mode 100644 index 0000000..7623c17 --- /dev/null +++ b/debian/patches/0002-Manpage-and-typo-fixes.patch @@ -0,0 +1,180 @@ +From: Christian Kastner +Date: Thu, 28 Jul 2011 11:07:40 +0200 +Subject: Manpage and typo fixes + +Correct some errors or clarify sections in the manpages; fix some typos +--- + man/cron.8 | 37 +++++++++++++++++-------------------- + man/crontab.1 | 2 +- + man/crontab.5 | 14 +++++++------- + src/cron.c | 4 ++-- + 4 files changed, 27 insertions(+), 30 deletions(-) + +diff --git a/man/cron.8 b/man/cron.8 +index 36006ca..e20455e 100644 +--- a/man/cron.8 ++++ b/man/cron.8 +@@ -27,7 +27,7 @@ + crond \- daemon to execute scheduled commands + .SH SYNOPSIS + .B crond +-.RB [ -n " | " -p " | " -s " | " -c " | " -m \fP\fI\fP ] ++.RB [ -n " | " -i " | " -p " | " -s " | " -c " | " -m \fP\fI\fP ] + + .B crond + .B -x +@@ -35,18 +35,15 @@ crond \- daemon to execute scheduled commands + .br + .SH DESCRIPTION + .I Cron +-is started from +-.I /etc/rc.d/init.d +-or +-.I /etc/init.d +-It returns immediately, thus, there is no need to need to start it with the '&' parameter. ++is automatically started at boot time. + .PP + .I Cron + searches + .I /var/spool/cron +-for crontab files which are named after accounts in +-.I /etc/passwd; +-The found crontabs are loaded into the memory. ++for crontab files which are named after user accounts; ++together with the system crontab ++.IR /etc/crontab , ++the found crontabs are loaded into the memory. + .I Cron + also searches for + any files in the +@@ -65,10 +62,10 @@ Any job output can also be sent to syslog by using the + option. + .PP + There are two ways how changes in crontables are checked. The first +-method is checking the modtime of a file. The second method is using the inotify support. +-Using of inotify is logged in the +-.I /var/log/cron +-log after the daemon is started. The inotify support checks for changes in all crontables and accesses the ++method is checking the modtime of a file. The second method ++is using inotify support, which is only available on Linux. ++When the daemon uses inotify, it logs this fact to syslog on startup. ++The inotify support checks for changes in all crontables and accesses the + hard disk only when a change is detected. + .PP + When using the modtime option, +@@ -89,13 +86,9 @@ for more details. + directory that contains system cronjobs stored for different users. + .IR /var/spool/cron + directory that contains user crontables created by the +-.IR crontab ++.BR crontab (1) + command. + +-Note that the +-.BR crontab (1) +-command updates the modtime of the spool directory whenever it changes a +-crontab. + .PP + .SS Daylight Saving Time and other time changes + Local time changes of less than three hours, such as those caused +@@ -135,16 +128,20 @@ This command must accept a fully formatted mail message (with headers) on standa + as a mail message to the recipients specified in the mail headers. Specifying + the string + .I "off" +-(i.e. crond -m off) ++(i.e. crond \-m off) + will disable the sending of mail. + .TP + .B "\-n" + Tells the daemon to run in the foreground. This can be useful when starting it out of init. + .TP ++.B "\-i" ++Disables inotify support (if present) ++.TP + .B "\-p" + Allows + .I Cron +-to accept any user set crontables. ++to accept any user set crontables (read: lift owner, type and mode ++restrictions) + .TP + .B "\-c" + This option enables clustering support, as described below. +diff --git a/man/crontab.1 b/man/crontab.1 +index d35331a..c1c8bae 100644 +--- a/man/crontab.1 ++++ b/man/crontab.1 +@@ -86,7 +86,7 @@ or modify system cron jobs in the + .IR /etc/cron.d/ + directory. + .PP +-The temporary directory can be set in an environment variable. If it is not set ++The temporary directory can be set using the environment variable $TMPDIR. If it is not set + by the user, the + .I /tmp + directory is used. +diff --git a/man/crontab.5 b/man/crontab.5 +index 6853b73..03c034f 100644 +--- a/man/crontab.5 ++++ b/man/crontab.5 +@@ -35,7 +35,7 @@ their own crontabs, eliminating the need for explicitly running + as part of a cron command. + .PP + Blank lines, leading spaces, and tabs are ignored. Lines whose first +-non-white space character is a pound-sign (#) are comments, and are note processed. ++non-white space character is a pound-sign (#) are comments, and are not processed. + Note that comments are not allowed on the same line as cron commands, since + they are considered a part of the command. Similarly, comments are not + allowed on the same line as environment variable settings. +@@ -235,7 +235,7 @@ CRON_TZ=Japan + # run at 2:15pm on the first of every month -- output mailed to paul + 15 14 1 * * $HOME/bin/monthly + # run at 10 pm on weekdays, annoy Joe +-0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% ++0 22 * * 1-5 mail \-s "It's 10pm" joe%Joe,%%Where are your kids?% + 23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday" + 5 4 * * sun echo "run at 5 after 4 every sunday" + .fi +@@ -255,7 +255,7 @@ MAILTO=root + * * * * * root touch /tmp/file + .fi + .SH SELinux with multi level security (MLS) +-In a crontab, it is important to specify a security level by \fIcrontab\ -s\fR or specifying ++In a crontab, it is important to specify a security level by \fIcrontab\ \-s\fR or specifying + the required level on the first line of the crontab. Each level is specified + in \fI/etc/selinux/targeted/seusers\fR. When using crontab in the MLS mode, it is especially important to: + .br +@@ -265,13 +265,13 @@ in \fI/etc/selinux/targeted/seusers\fR. When using crontab in the MLS mode, it i + .SH EXAMPLE FOR SELINUX MLS + .nf + # login as root +-newrole -r sysadm_r ++newrole \-r sysadm_r + mkdir /tmp/SystemHigh +-chcon -l SystemHigh /tmp/SystemHigh +-crontab -e ++chcon \-l SystemHigh /tmp/SystemHigh ++crontab \-e + # write in crontab file + MLS_LEVEL=SystemHigh +-0-59 * * * * id -Z > /tmp/SystemHigh/crontest ++0-59 * * * * id \-Z > /tmp/SystemHigh/crontest + .fi + .SH FILES + .I /etc/crontab +diff --git a/src/cron.c b/src/cron.c +index 7dc2958..760bafe 100644 +--- a/src/cron.c ++++ b/src/cron.c +@@ -137,8 +137,8 @@ static void usage(void) { + const char **dflags; + + fprintf(stderr, "usage: %s [-h] print this message \n \ +- [-i] deamon runs without inotify support \n \ +- [-m ] off or specify prefered client for sending mails \n \ ++ [-i] daemon runs without inotify support \n \ ++ [-m ] off or specify preferred client for sending mails \n \ + [-n] run in foreground \n \ + [-p] permit any crontab \n \ + [-c] enable clustering support \n \ +-- diff --git a/debian/patches/0003-Rename-PAM-service-to-cronie.patch b/debian/patches/0003-Rename-PAM-service-to-cronie.patch new file mode 100644 index 0000000..117e2d3 --- /dev/null +++ b/debian/patches/0003-Rename-PAM-service-to-cronie.patch @@ -0,0 +1,44 @@ +From: Christian Kastner +Date: Thu, 28 Jul 2011 11:11:45 +0200 +Subject: Rename PAM service to cronie + +Upstream uses "crond"; we switch to "cron" to avoid confusion with Debian's ISC +cron (it uses "cron" but that might change). + +Forwaded: not-needed +Last-Update: 2011-07-28 +--- + Makefile.am | 5 ----- + src/security.c | 2 +- + 2 files changed, 1 insertions(+), 6 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 05c541a..8fa4d97 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,11 +3,6 @@ if ANACRON + SUBDIRS += anacron + endif + +-if PAM +-pamdir = $(sysconfdir)/pam.d +-dist_pam_DATA = pam/crond +-endif +- + EXTRA_DIST = cronie.init crond.sysconfig contrib/anacrontab \ + contrib/0anacron contrib/0hourly \ + contrib/dailyjobs +diff --git a/src/security.c b/src/security.c +index f6940a5..28dda4d 100644 +--- a/src/security.c ++++ b/src/security.c +@@ -172,7 +172,7 @@ int cron_start_pam(struct passwd *pw) { + int retcode = 0; + + #if defined(WITH_PAM) +- retcode = pam_start("crond", pw->pw_name, &conv, &pamh); ++ retcode = pam_start("cronie", pw->pw_name, &conv, &pamh); + PAM_FAIL_CHECK; + retcode = pam_set_item(pamh, PAM_TTY, "cron"); + PAM_FAIL_CHECK; +-- diff --git a/debian/patches/0004-Debian-specific-paths-and-features.patch b/debian/patches/0004-Debian-specific-paths-and-features.patch new file mode 100644 index 0000000..b56b877 --- /dev/null +++ b/debian/patches/0004-Debian-specific-paths-and-features.patch @@ -0,0 +1,80 @@ +From: Christian Kastner +Date: Thu, 28 Jul 2011 11:15:01 +0200 +Subject: Debian-specific paths and features + +Use Debian-specific paths and features. For example, the spool dir differs from +upstream, and we always build to use syslog. + +Forwarded: not-needed +Last-Update: 2011-07-28 +--- + man/cron.8 | 13 ++----------- + man/crontab.1 | 2 +- + man/crontab.5 | 2 +- + 3 files changed, 4 insertions(+), 13 deletions(-) + +diff --git a/man/cron.8 b/man/cron.8 +index e20455e..5f83546 100644 +--- a/man/cron.8 ++++ b/man/cron.8 +@@ -39,7 +39,7 @@ is automatically started at boot time. + .PP + .I Cron + searches +-.I /var/spool/cron ++.I /var/spool/cron/crontabs + for crontab files which are named after user accounts; + together with the system crontab + .IR /etc/crontab , +@@ -84,7 +84,7 @@ system crontab, usually used to run daily, weekly, monthly jobs. See + for more details. + .IR /etc/cron.d/ + directory that contains system cronjobs stored for different users. +-.IR /var/spool/cron ++.IR /var/spool/cron/crontabs + directory that contains user crontables created by the + .BR crontab (1) + command. +@@ -157,15 +157,6 @@ installed or if mail is disabled. + .TP + .B "\-x" + This option allows you to set debug flags. +-.SH SIGNALS +-When the \s-2SIGHUP\s+2 is received, the +-.I Cron +-daemon will close and reopen its +-log file. This proves to be useful in scripts which rotate and age log files. +-Naturally, this is not relevant if +-.I Cron +-was built to use +-.IR syslog (3). + .SH CLUSTERING SUPPORT + In this version of + .IR Cron +diff --git a/man/crontab.1 b/man/crontab.1 +index c1c8bae..9c32c8e 100644 +--- a/man/crontab.1 ++++ b/man/crontab.1 +@@ -56,7 +56,7 @@ more crontabs for each range. For more information, see + In this version of + .IR Cron + it is possible to use a network-mounted shared +-.I /var/spool/cron ++.I /var/spool/cron/crontabs + across a cluster of hosts and specify that only one of the hosts should + run the crontab jobs in the particular directory at any one time. You may also use + .BR crontab (1) +diff --git a/man/crontab.5 b/man/crontab.5 +index 03c034f..8a3692b 100644 +--- a/man/crontab.5 ++++ b/man/crontab.5 +@@ -276,7 +276,7 @@ MLS_LEVEL=SystemHigh + .SH FILES + .I /etc/crontab + system crontab file for jobs like cron.daily, weekly, monthly. +-.I /var/spool/cron/ ++.I /var/spool/cron/crontabs + a directory for storing crontabs defined by users. + .I /etc/cron.d/ + a directory for storing system crontables. +-- diff --git a/debian/patches/0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch b/debian/patches/0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch new file mode 100644 index 0000000..702acaf --- /dev/null +++ b/debian/patches/0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch @@ -0,0 +1,41 @@ +From: Christian Kastner +Date: Sun, 7 Aug 2011 19:48:09 +0200 +Subject: Extend support for kFreeBSD and GNU HURD + +Extend some of the #ifdefs to include kFreeBSD and HURD where it's obviously OK +to do so + +Forwarded: no +Last-Update: 2011-08-07 +--- + src/entry.c | 2 +- + src/pathnames.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/entry.c b/src/entry.c +index 5d377c6..d03ddb1 100644 +--- a/src/entry.c ++++ b/src/entry.c +@@ -335,7 +335,7 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, + } + else + log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0); +-#if defined(BSD) || defined(__linux) ++#if defined(BSD) || defined(__linux) || defined(__GLIBC__) || defined(__gnu_hurd__) + if (glue_strings(envstr, sizeof envstr, "USER", pw->pw_name, '=')) { + if ((tenvp = env_set(e->envp, envstr)) == NULL) { + ecode = e_memory; +diff --git a/src/pathnames.h b/src/pathnames.h +index b5d5c70..25d90c3 100644 +--- a/src/pathnames.h ++++ b/src/pathnames.h +@@ -26,7 +26,7 @@ + #ifndef _PATHNAMES_H_ + #define _PATHNAMES_H_ + +-#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX) ++#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX) || defined(__GLIBC__) || defined(__gnu_hurd__) + # include + #endif /*BSD*/ + +-- diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..3b253e6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,5 @@ +0001-Unbundle-anacron.patch +0002-Manpage-and-typo-fixes.patch +0003-Rename-PAM-service-to-cronie.patch +0004-Debian-specific-paths-and-features.patch +0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch diff --git a/debian/placeholder b/debian/placeholder new file mode 100644 index 0000000..bc60cfe --- /dev/null +++ b/debian/placeholder @@ -0,0 +1,2 @@ +# DO NOT REMOVE +# this file prevents dpkg from removing this directory diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..9c56107 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +# Analogous to Debian's ISC cron postinst script (for compatibility reasons) + +tabsdir="/var/spool/cron/crontabs" + +# Make sure group "crontab" exists (needed for running SGID) +getent group crontab > /dev/null 2>&1 || addgroup --system crontab + +# Make crontab(1) SGID +if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null +then + dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab +fi + +# Adjust permissions for spool dir +# Can't use dpkg-statoverride for this because it doesn't cooperate nicely +# with cron alternatives such as bcron +if [ -d $tabsdir ] ; then + chown root:crontab $tabsdir + # This must be in sync with misc.c:check_spool_dir() + chmod 1730 $tabsdir + + cd $tabsdir + if [ -n "`ls -A $tabsdir`" ] + then + for tabname in * + do + chown $tabname:crontab $tabname && chmod 600 $tabname || continue + done + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..b520138 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..b520138 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..607f9d8 --- /dev/null +++ b/debian/rules @@ -0,0 +1,68 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# Add build flags +CFLAGS += -Wall + + +# Build the config options string +CONFIG_OPTIONS = + +# PAM is enabled by default +ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS))) + CONFIG_OPTIONS += --with-pam +endif + +### Linux-only options ### +ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), linux) + +# SELINUX is enabled by default +ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS))) + CONFIG_OPTIONS += --with-selinux +endif + +# inotify is enabled by default +ifeq (,$(findstring noinotify,$(DEB_BUILD_OPTIONS))) + CONFIG_OPTIONS += --with-inotify +endif + +# audit is disabled by default +ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS))) + CONFIG_OPTIONS += --with-audit +endif + +endif +### End Linux-only ### + + +%: + dh $@ --with autoreconf + +# Set SPOOL_DIR to Debian's traditional location for crontabs (see Policy) +# Set CRON_GROUP to "crontab" to enable SGID functionality (avoids SUID) +override_dh_auto_configure: + SPOOL_DIR=/var/spool/cron/crontabs dh_auto_configure CRON_GROUP=crontab -- $(CONFIG_OPTIONS) + +override_dh_install: + dh_install + # Create /etc/cron.deny to allow crontab(1) for all users by default + install -m 644 debian/cronie.deny debian/cronie/etc/cron.deny + # System-wide crontab + install -m 644 debian/crontab.system debian/cronie/etc/crontab + # Placeholders for dpkg + install -m 644 debian/placeholder debian/cronie/etc/cron.d/.placeholder + install -m 644 debian/placeholder debian/cronie/etc/cron.hourly/.placeholder + install -m 644 debian/placeholder debian/cronie/etc/cron.daily/.placeholder + install -m 644 debian/placeholder debian/cronie/etc/cron.weekly/.placeholder + install -m 644 debian/placeholder debian/cronie/etc/cron.monthly/.placeholder + +# Don't need stop (redundant with sendsigs) +override_dh_installinit: + dh_installinit -- start 89 2 3 4 5 . + +override_dh_clean: + dh_clean + rm -f src/cron-paths.h diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..f7fe106 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 + +https://fedorahosted.org/releases/c/r/cronie/cronie-(.*)\.tar\.gz