Package: cron
Version: 3.0pl1-137
Followup-For: Bug #887035
X-Debbugs-Cc: Greek <greek64.m...@gmail.com>, Javier Fernández-Sanguino Peña 
<j...@debian.org>, Georges Khaznadar <georg...@debian.org>

Instead of patching cron, an easy way to get cron output to stdout is
to:

* rebuild it with debugging enabled:

      $ apt-get source cron
      $ apt-get build-dep cron
      $ cd cron-3.0pl1
      $ DEB_BUILD_OPTIONS=debug dpkg-buildpackage -rfakeroot

* use the undocumented `-x` option of Debian's cron to start it:

       # cron -f -L 15 -x misc

  (I found the `misc` debug log the most suiting)

* wrap the whole thing to redirect stderr to stdout:

      $ cat run-cron
      #!/bin/sh
      exec cron -f -L 15 -x misc 2>&1

@Georges Khaznadar : what do you think about:

1. enabling debugging by default?
2. documenting `-x` ?

If Debian would enable the "debbugging feature" of its cron by default,
then this would add this overhead in a few places:

    if ( (DebugFlags & (mask) )  ) printf message;

Since DebugFlags is 0 by default, this will ad an overhead of about two
machine instructions I guess to a few places, which is a neglible
waste/slowdown IMHO.

With the "debugging feature" enabled Debian's cron will gain the very
nice features:

a) for the sysadmin to be able to debug what cron is doing and why and
b) use the sysadmin being able to use Debian's cron in docker and kubernetes.

IMHO a huge gain that costs nothing.

?
*t

-- Package-specific info:
--- EDITOR:


--- /usr/bin/editor:
/usr/bin/vim.gtk3

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 43568 Feb 22  2021 /usr/bin/crontab

--- /var/spool/cron:
drwxr-xr-x 3 root root 4096 Apr 10  2021 /var/spool/cron

--- /var/spool/cron/crontabs:
drwx-wx--T 2 root crontab 4096 Feb 22  2021 /var/spool/cron/crontabs

--- /etc/cron.d:
drwxr-xr-x 2 root root 4096 Jul 22 15:03 /etc/cron.d

--- /etc/cron.daily:
drwxr-xr-x 2 root root 4096 Jul 11 09:33 /etc/cron.daily

--- /etc/cron.hourly:
drwxr-xr-x 2 root root 4096 Apr 10  2021 /etc/cron.hourly

--- /etc/cron.monthly:
drwxr-xr-x 2 root root 4096 Apr 10  2021 /etc/cron.monthly

--- /etc/cron.weekly:
drwxr-xr-x 2 root root 4096 Apr 10  2021 /etc/cron.weekly


-- System Information:
Debian Release: 11.4
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-16-amd64 (SMP w/8 CPU threads)
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_CH:de
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cron depends on:
ii  adduser              3.118
ii  debianutils          4.11.2
ii  init-system-helpers  1.60
ii  libc6                2.31-13+deb11u3
ii  libpam-runtime       1.4.0-9+deb11u1
ii  libpam0g             1.4.0-9+deb11u1
ii  libselinux1          3.1-3
ii  lsb-base             11.1.0
ii  sensible-utils       0.0.14

Versions of packages cron recommends:
ii  msmtp-mta [mail-transport-agent]  1.8.11-2.1

Versions of packages cron suggests:
ii  anacron        2.3-30
pn  checksecurity  <none>
ii  logrotate      3.18.0-2+deb11u1

Versions of packages cron is related to:
pn  libnss-ldap   <none>
pn  libnss-ldapd  <none>
pn  libpam-ldap   <none>
pn  libpam-mount  <none>
pn  nis           <none>
pn  nscd          <none>

-- no debconf information

Reply via email to