This commit is contained in:
Mario Fetka 2019-08-06 19:01:25 +02:00
parent 16e9a0ed83
commit 38f79ab6a4
7 changed files with 44 additions and 319 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
cronie (1.5.4-1) UNRELEASED; urgency=medium
* Bump
-- Mario Fetka <mario.fetka@gmail.com> Tue, 06 Aug 2019 18:29:32 +0200
cronie (1.4.8-1~exp1) experimental; urgency=low
* Initial release (Closes: #590876)

View File

@ -9,46 +9,31 @@ 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
Index: cronie/man/cron.8
===================================================================
--- cronie.orig/man/cron.8 2019-08-06 18:47:39.324000000 +0200
+++ cronie/man/cron.8 2019-08-06 18:47:39.324000000 +0200
@@ -56,8 +56,7 @@
The found crontabs are loaded into the memory.
.I Cron
also searches for
also searches for
-.I /etc/anacrontab
-and any files in the
-and any files in the
+any files in the
.I /etc/cron.d
.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:
@@ -94,9 +93,9 @@
system crontab. Nowadays the file is empty by default. Originally it
was usually used to run daily, weekly, monthly jobs. By default these
jobs are now run through anacron which reads
-.IR /etc/anacrontab
+.IR /etc/crontab
system crontab, usually used to run daily, weekly, monthly jobs. See
configuration file. See
-.BR anacrontab (5)
+.BR crontab (5)
for more details.
.TP
.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.
--

View File

@ -1,180 +0,0 @@
From: Christian Kastner <debian@kvr.at>
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<mail command>\fP ]
+.RB [ -n " | " -i " | " -p " | " -s " | " -c " | " -m \fP\fI<mail command>\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 <mail command>] off or specify prefered client for sending mails \n \
+ [-i] daemon runs without inotify support \n \
+ [-m <mail command>] off or specify preferred client for sending mails \n \
[-n] run in foreground \n \
[-p] permit any crontab \n \
[-c] enable clustering support \n \
--

View File

@ -12,33 +12,30 @@ Last-Update: 2011-07-28
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
Index: cronie/Makefile.am
===================================================================
--- cronie.orig/Makefile.am 2019-08-06 18:53:14.280000000 +0200
+++ cronie/Makefile.am 2019-08-06 18:54:00.684000000 +0200
@@ -13,9 +13,3 @@
contrib/cronie.systemd \
anacron/ChangeLog.anacron
-if PAM
-pamdir = $(sysconfdir)/pam.d
-dist_pam_DATA = pam/crond
-else
-EXTRA_DIST += 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) {
Index: cronie/src/security.c
===================================================================
--- cronie.orig/src/security.c 2019-08-06 18:53:14.280000000 +0200
+++ cronie/src/security.c 2019-08-06 18:53:43.064000000 +0200
@@ -195,7 +195,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;
--

View File

@ -1,80 +0,0 @@
From: Christian Kastner <debian@kvr.at>
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.
--

View File

@ -12,11 +12,11 @@ Last-Update: 2011-08-07
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,
Index: cronie/src/entry.c
===================================================================
--- cronie.orig/src/entry.c 2019-08-06 18:57:12.824000000 +0200
+++ cronie/src/entry.c 2019-08-06 18:57:12.812000000 +0200
@@ -379,7 +379,7 @@
}
else
log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0);
@ -25,10 +25,10 @@ index 5d377c6..d03ddb1 100644
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
Index: cronie/src/pathnames.h
===================================================================
--- cronie.orig/src/pathnames.h 2019-08-06 18:57:12.824000000 +0200
+++ cronie/src/pathnames.h 2019-08-06 18:57:12.812000000 +0200
@@ -26,7 +26,7 @@
#ifndef _PATHNAMES_H_
#define _PATHNAMES_H_
@ -38,4 +38,3 @@ index b5d5c70..25d90c3 100644
# include <paths.h>
#endif /*BSD*/
--

View File

@ -1,5 +1,3 @@
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