#1029140 cron-apt refuses to run when RUNSLEEP is set

#1029140#5
Date:
2023-01-18 14:07:43 UTC
From:
To:
Dear Maintainer,
when running cron-apt as shipped it works normal, running at 4 am and sending an email when anything can be updated. But when adding the recommended RUNSLEEP variable to the config, the only thing that happens is throwing a kernel error at 4 am:

     2022-12-19T04:00:01.425628+01:00 ts CRON[75874]: (root) CMD (test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt)
     2022-12-19T04:00:01.468596+01:00 ts kernel: [276052.628108] traps: cksum[75885] trap invalid opcode ip:562d9fe03cf5 sp:7ffd9b53fe20 error:0 in cksum[562d9fded000+17000]
     2022-12-19T04:00:02.525060+01:00 ts sSMTP[75887]: Sent mail for root@ts.domain.de (221 mailserver.de) uid=0 username=root outbytes=691

Even though it says a mail is sent, it's not received. Since cron-apt clearly doesn't run at all, that might be the reason. Running cron-apt manually with RUNSLEEP set with "cron-apt -s" works without problems.

#1029140#10
Date:
2023-01-23 21:10:25 UTC
From:
To:
Hi

When you run cron-apt from a terminal RUNSLEEP is not used. This is why it
works when running manually.

Please try running the following in a command

sleep 456

or any large number for sleep.

Do you have some special kernel? The kernel should not give that problem.

cron-apt do not do anything magic. It just executes sleep

It could also be that it is not the sleep command itself. It could be the
random number generation done a few lines earlier in that script.

// Ola

#1029140#15
Date:
2023-01-23 22:20:14 UTC
From:
To:
Hi,
sleep 456 and sleep 1200 work without any problems. Also, I don't have any special kernel. Currently, Output of uname -a is "Linux ts 6.1.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.4-1 (2023-01-07) x86_64 GNU/Linux". I don't even have any other repository active other than the typical Debian ones (testing, testing-updates, testing-backports, testing-security).

Also, I'm noticing cron-apt becoming less reliable in the last weeks (I actually wanted to report this before Christmas, but something must have went wrong so I only got the email, but it probably was never sent to the bugreport mailing list). It used to reliably send mails every day at which it finds any updates. But in the last weeks, it mostly doesn't do that anymore. The log in journalctl/syslog always shows the same text (only difference in the checksum and so on). RUNSLEEP has been commented out for weeks now.

Richard

Am Montag, 23. Januar 2023 22:10 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Hi When you run cron-apt from a terminal RUNSLEEP is not used. This is why it works when running manually.

Please try running the following in a command

sleep 456

or any large number for sleep.

Do you have some special kernel? The kernel should not give that problem.

cron-apt do not do anything magic. It just executes sleep

It could also be that it is not the sleep command itself. It could be the random number generation done a few lines earlier in that script. // Ola On Wed, 18 Jan 2023 at 15:12, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:Package: cron-apt
Version: 0.13.0.1
Severity: important
X-Debbugs-Cc: submit@bugs.debian.org

Dear Maintainer,
when running cron-apt as shipped it works normal, running at 4 am and sending an email when anything can be updated. But when adding the recommended RUNSLEEP variable to the config, the only thing that happens is throwing a kernel error at 4 am:

     2022-12-19T04:00:01.425628+01:00 ts CRON[75874]: (root) CMD (test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt)
     2022-12-19T04:00:01.468596+01:00 ts kernel: [276052.628108] traps: cksum[75885] trap invalid opcode ip:562d9fe03cf5 sp:7ffd9b53fe20 error:0 in cksum[562d9fded000+17000]
     2022-12-19T04:00:02.525060+01:00 ts sSMTP[75887]: Sent mail for root@ts.domain.de (221 mailserver.de) uid=0 username=root outbytes=691

Even though it says a mail is sent, it's not received. Since cron-apt clearly doesn't run at all, that might be the reason. Running cron-apt manually with RUNSLEEP set with "cron-apt -s" works without problems.

#1029140#20
Date:
2023-01-24 08:16:10 UTC
From:
To:
Hi Richard

Strange!

Can you try to copy cron-apt and comment this:

if [ -t 0 ]; then
    RUNIMMEDIATELY="yes"
fi

And then run manually.

bash -x your-cron-apt-copy

It would help to understand what happens.

// Ola

On Mon, 23 Jan 2023 at 23:30, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:

#1029140#25
Date:
2023-01-24 13:11:30 UTC
From:
To:
This is the output (not sure if attachments are possible here, so I put it into the body):
+ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+ UMASK_TIGHT=077
+ UMASK_APT=022
+ umask 077
+ STDOUT=
+ ALLCONFIGS=
+ '[' -n '' ']'
+ '[' -z '' ']'
+ CONFIG=/etc/cron-apt/config
+ ALLCONFIGS=/etc/cron-apt/config
+ LIBDIR=/var/lib/cron-apt
+ SHAREDIR=/usr/share/cron-apt
++ echo /etc/cron-apt/config
++ sed 's|/|_-_|g'
+ CONFIGDIRNAME=_-_etc_-_cron-apt_-_config
++ mktemp -d -t cron-apt.XXXXXX
+ TMPDIR=/tmp/cron-apt.X5DFeL
+ '[' 0 -ne 0 ']'
+ INITLOG=/tmp/cron-apt.X5DFeL/initlog
+ RUNERROR=/tmp/cron-apt.X5DFeL/runerror
+ RUNSYSLOG=/tmp/cron-apt.X5DFeL/runsyslog
+ RUNLOG=/tmp/cron-apt.X5DFeL/runlog
+ RUNMAIL=/tmp/cron-apt.X5DFeL/runmail
+ ACTIONERROR=/tmp/cron-apt.X5DFeL/actionerror
+ ACTIONSYSLOG=/tmp/cron-apt.X5DFeL/actionsyslog
+ ACTIONLOG=/tmp/cron-apt.X5DFeL/actionlog
+ ACTIONMAIL=/tmp/cron-apt.X5DFeL/actionmail
+ TEMP=/tmp/cron-apt.X5DFeL/temp
+ MAIL=/tmp/cron-apt.X5DFeL/mail
+ DIFF=/tmp/cron-apt.X5DFeL/difftemp
+ STATUS=/tmp/cron-apt.X5DFeL/status
+ LOCKFILE=/var/lib/cron-apt/lockfile
+ MAILCHDIR=/var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges
+ ERROR=/tmp/cron-apt.X5DFeL/_-_etc_-_cron-apt_-_config-error
+ ACTIONDIR=/etc/cron-apt/action.d
+ ACTIONCONFDIR=/etc/cron-apt/config.d
+ MAILMSGDIR=/etc/cron-apt/mailmsg.d
+ MAILONMSGSDIR=/etc/cron-apt/mailonmsgs
+ SYSLOGONMSGSDIR=/etc/cron-apt/syslogonmsgs
+ REFRAINFILE=/etc/cron-apt/refrain
+ NOLOCKWARN=
+ ERRORMSGDIR=/etc/cron-apt/errormsg.d
+ SYSLOGMSGDIR=/etc/cron-apt/syslogmsg.d
+ LOGMSGDIR=/etc/cron-apt/logmsg.d
+ LOGDIR=/var/log/cron-apt
+ LOG=/var/log/cron-apt/log
+ LASTFULLMESSAGE=/var/log/cron-apt/lastfullmessage
+ DIFFONCHANGES=prepend
+ SUBJECTPREFIX=CRON-APT
+ MAILTO=root
+ MAILWIDTH=900
+ SYSLOGON=upgrade
+ MAILON=error
+ EXITON=error
+ DEBUG=verbose
+ OPTIONS='-o quiet=1'
+ DONTRUN=
+ RUNSLEEP=3600
+ MINTMPDIRSIZE=10
+ APTCOMMAND=/usr/bin/apt-get
+ HOSTNAME=
+ DIFFIGNORE=
+ DIFFONCHANGES=prepend
+ export DEBIAN_FRONTEND=noninteractive
+ DEBIAN_FRONTEND=noninteractive
+ export LANG=C
+ LANG=C
+ export LC_ALL=C
+ LC_ALL=C
+ for cfg in $ALLCONFIGS
+ '[' -f /etc/cron-apt/config ']'
+ . /etc/cron-apt/config
++ APTCOMMAND=/usr/bin/apt-get
++ MAILTO=administrator@fsmuw.rwth-aachen.de
++ MAILON=upgrade
++ SYSLOGON=always
+ test '' = yes
+ . /usr/share/cron-apt/functions
+ '[' -d /var/lib/cron-apt/_-_etc_-_cron-apt_-_config ']'
+ '[' -d /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges ']'
+ '[' -e /etc/cron-apt/refrain ']'
+ checktmpsize
++ stat --file-system --format=%S /tmp/cron-apt.X5DFeL
+ SSIZE=4096
++ stat --file-system --format=%a /tmp/cron-apt.X5DFeL
+ FSCOUNT=1021394
+ '[' 1021394 -lt 33554432 ']'
+ '[' 4085576 -lt 10 ']'
++ date
+ echo 'CRON-APT RUN [/etc/cron-apt/config]: Tue Jan 24 13:15:27 CET 2023'
+ '[' -n 3600 ']'
+ '[' 3600 -gt 0 ']'
+ '[' -z 10031 ']'
+ TIME=842
+ sleep 842
++ date
+ echo 'CRON-APT SLEEP: 842, Tue Jan 24 13:29:29 CET 2023'
+ '[' -e /etc/cron-apt/refrain ']'
+ checktmpsize
++ stat --file-system --format=%S /tmp/cron-apt.X5DFeL
+ SSIZE=4096
++ stat --file-system --format=%a /tmp/cron-apt.X5DFeL
+ FSCOUNT=1021393
+ '[' 1021393 -lt 33554432 ']'
+ '[' 4085572 -lt 10 ']'
+ '[' -x /usr/bin/dotlockfile ']'
+ dotlockfile -l -p -r 10 /var/lib/cron-apt/lockfile
+ cp /tmp/cron-apt.X5DFeL/initlog /tmp/cron-apt.X5DFeL/runmail
+ cp /tmp/cron-apt.X5DFeL/initlog /tmp/cron-apt.X5DFeL/runlog
+ cp /tmp/cron-apt.X5DFeL/initlog /tmp/cron-apt.X5DFeL/runsyslog
+ cp /tmp/cron-apt.X5DFeL/initlog /tmp/cron-apt.X5DFeL/runerror
+ rm -f /tmp/cron-apt.X5DFeL/initlog
++ run_parts /etc/cron-apt/action.d
++ unset LANG LC_COLLATE LC_ALL
++ '[' -z /etc/cron-apt/action.d ']'
++ '[' '!' -d /etc/cron-apt/action.d ']'
+++ ls /etc/cron-apt/action.d
++ for F in $(ls $1)
++ expr '#0-update#' : '[[:alnum:]_-]\+$'
++ for F in $(ls $1)
++ expr 0-update : '[[:alnum:]_-]\+$'
++ '[' -f /etc/cron-apt/action.d/0-update ']'
++ echo /etc/cron-apt/action.d/0-update
++ for F in $(ls $1)
++ expr 3-download : '[[:alnum:]_-]\+$'
++ '[' -f /etc/cron-apt/action.d/3-download ']'
++ echo /etc/cron-apt/action.d/3-download
+ for ACTION in $(run_parts "$ACTIONDIR")
++ echo /etc/cron-apt/action.d/0-update
++ sed 's|/etc/cron-apt/action.d/||'
+ ACTIONF=0-update
+ '[' -f /etc/cron-apt/config.d/0-update ']'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ herevariables_store
+ general_varmove HERE STORED
+ PREFIX=HERE
+ STORE=STORED
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_HERE='
++ sed -e 's|=.*||;'
+ LIST=
+ cat /etc/cron-apt/action.d/0-update
+ sed -e 's/#.*$//;'
+ grep -v '^[[:space:]]*$'
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 update -o quiet=2'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 update -o quiet=2
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.X5DFeL/temp
+ '[' always = always ']'
+ createsysloginfo 0-update
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/syslogmsg.d/0-update /tmp/cron-apt.X5DFeL/runsyslog /tmp/cron-apt.X5DFeL/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/0-update
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/0-update ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/0-update ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runsyslog ']'
+ tomsg /tmp/cron-apt.X5DFeL/runsyslog syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/runsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/runsyslog
+ rm -f /tmp/cron-apt.X5DFeL/runsyslog
+ '[' -n /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ tomsg /tmp/cron-apt.X5DFeL/actionsyslog syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/actionsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/actionsyslog
+ rm -f /tmp/cron-apt.X5DFeL/actionsyslog
+ tomsg /tmp/cron-apt.X5DFeL/temp syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 0-update
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/logmsg.d/0-update /tmp/cron-apt.X5DFeL/runlog /tmp/cron-apt.X5DFeL/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/0-update
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runlog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/0-update ']'
+ '[' -f /etc/cron-apt/logmsg.d/0-update ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runlog ']'
+ tomsg /tmp/cron-apt.X5DFeL/runlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/runlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/runlog
+ rm -f /tmp/cron-apt.X5DFeL/runlog
+ '[' -n /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionlog ']'
+ tomsg /tmp/cron-apt.X5DFeL/actionlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/actionlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/actionlog
+ rm -f /tmp/cron-apt.X5DFeL/actionlog
+ tomsg /tmp/cron-apt.X5DFeL/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.X5DFeL/temp
++ echo 'update -o quiet=2'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=bd7e303bb529e32e21411dab0e365376
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/0-update-bd7e303bb529e32e21411dab0e365376 ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/0-update-bd7e303bb529e32e21411dab0e365376 /tmp/cron-apt.X5DFeL/temp
+ rm -f /tmp/cron-apt.X5DFeL/difftemp
+ read LINE
+ '[' -e /tmp/cron-apt.X5DFeL/status ']'
+ herevariables_restore
+ general_varmove STORED ''
+ PREFIX=STORED
+ STORE=
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_STORED='
++ sed -e 's|=.*||;'
+ LIST=
+ for ACTION in $(run_parts "$ACTIONDIR")
++ echo /etc/cron-apt/action.d/3-download
++ sed 's|/etc/cron-apt/action.d/||'
+ ACTIONF=3-download
+ '[' -f /etc/cron-apt/config.d/3-download ']'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ herevariables_store
+ general_varmove HERE STORED
+ PREFIX=HERE
+ STORE=STORED
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_HERE='
++ sed -e 's|=.*||;'
+ LIST=
+ cat /etc/cron-apt/action.d/3-download
+ sed -e 's/#.*$//;'
+ grep -v '^[[:space:]]*$'
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 autoclean -y'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 autoclean -y
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.X5DFeL/temp
+ '[' always = always ']'
+ createsysloginfo 3-download
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/syslogmsg.d/3-download /tmp/cron-apt.X5DFeL/runsyslog /tmp/cron-apt.X5DFeL/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -n /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ tomsg /tmp/cron-apt.X5DFeL/actionsyslog syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/actionsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/actionsyslog
+ rm -f /tmp/cron-apt.X5DFeL/actionsyslog
+ tomsg /tmp/cron-apt.X5DFeL/temp syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 3-download
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/logmsg.d/3-download /tmp/cron-apt.X5DFeL/runlog /tmp/cron-apt.X5DFeL/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runlog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -n /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionlog ']'
+ tomsg /tmp/cron-apt.X5DFeL/actionlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/actionlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -r /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/actionlog
+ rm -f /tmp/cron-apt.X5DFeL/actionlog
+ tomsg /tmp/cron-apt.X5DFeL/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.X5DFeL/temp
+ '[' always = output ']'
+ '[' upgrade = output ']'
+ '[' verbose = upgrade ']'
++ echo 'autoclean -y'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=58797c9195c34287e12120e4b46fb611
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-58797c9195c34287e12120e4b46fb611 ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-58797c9195c34287e12120e4b46fb611 /tmp/cron-apt.X5DFeL/temp
+ cp /tmp/cron-apt.X5DFeL/temp /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-58797c9195c34287e12120e4b46fb611
+ '[' -n /tmp/cron-apt.X5DFeL/difftemp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/difftemp ']'
+ '[' prepend = only ']'
+ '[' prepend = append ']'
+ '[' prepend = prepend ']'
+ echo '----- DIFF END HERE -----'
+ cat /tmp/cron-apt.X5DFeL/temp
+ mv /tmp/cron-apt.X5DFeL/difftemp /tmp/cron-apt.X5DFeL/temp
+ '[' upgrade = changes ']'
+ '[' always = changes ']'
+ '[' verbose = changes ']'
+ rm -f /tmp/cron-apt.X5DFeL/difftemp
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 dist-upgrade -d -y -o APT::Get::Show-Upgraded=true'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.X5DFeL/temp
+ '[' always = upgrade ']'
+ '[' upgrade = upgrade ']'
+ createmailinfo 3-download
+ touch /tmp/cron-apt.X5DFeL/mail
+ '[' -n upgrade ']'
+ '[' -f /etc/cron-apt/mailonmsgs/upgrade ']'
+ createdivinfo /tmp/cron-apt.X5DFeL/mail /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/mailmsg.d/3-download /tmp/cron-apt.X5DFeL/runmail /tmp/cron-apt.X5DFeL/actionmail
+ FILE=/tmp/cron-apt.X5DFeL/mail
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/mailmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runmail
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionmail
+ TMPSTDOUT=
+ '[' /tmp/cron-apt.X5DFeL/mail '!=' syslog ']'
+ touch /tmp/cron-apt.X5DFeL/mail
+ '[' -n /etc/cron-apt/mailmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/mailmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runmail ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runmail ']'
+ tomsg /tmp/cron-apt.X5DFeL/runmail /tmp/cron-apt.X5DFeL/mail ''
+ TCAT=/tmp/cron-apt.X5DFeL/runmail
+ TFILE=/tmp/cron-apt.X5DFeL/mail
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/runmail ']'
+ '[' -r /tmp/cron-apt.X5DFeL/runmail ']'
+ '[' -n '' ']'
+ '[' /tmp/cron-apt.X5DFeL/mail '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/runmail
+ rm -f /tmp/cron-apt.X5DFeL/runmail
+ '[' -n /tmp/cron-apt.X5DFeL/actionmail ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionmail ']'
+ tomsg /tmp/cron-apt.X5DFeL/actionmail /tmp/cron-apt.X5DFeL/mail ''
+ TCAT=/tmp/cron-apt.X5DFeL/actionmail
+ TFILE=/tmp/cron-apt.X5DFeL/mail
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/actionmail ']'
+ '[' -r /tmp/cron-apt.X5DFeL/actionmail ']'
+ '[' -n '' ']'
+ '[' /tmp/cron-apt.X5DFeL/mail '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/actionmail
+ rm -f /tmp/cron-apt.X5DFeL/actionmail
+ tomsg /tmp/cron-apt.X5DFeL/temp /tmp/cron-apt.X5DFeL/mail ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=/tmp/cron-apt.X5DFeL/mail
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' /tmp/cron-apt.X5DFeL/mail '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/temp
+ '[' verbose = upgrade ']'
+ '[' always = always ']'
+ createsysloginfo 3-download
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/syslogmsg.d/3-download /tmp/cron-apt.X5DFeL/runsyslog /tmp/cron-apt.X5DFeL/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -n /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ tomsg /tmp/cron-apt.X5DFeL/temp syslog ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.X5DFeL/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 3-download
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.X5DFeL/temp /etc/cron-apt/logmsg.d/3-download /tmp/cron-apt.X5DFeL/runlog /tmp/cron-apt.X5DFeL/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.X5DFeL/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.X5DFeL/runlog
+ OPTACTIONCAT=/tmp/cron-apt.X5DFeL/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -n /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionlog ']'
+ tomsg /tmp/cron-apt.X5DFeL/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.X5DFeL/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.X5DFeL/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.X5DFeL/temp
+ '[' always = output ']'
+ '[' upgrade = output ']'
+ '[' verbose = upgrade ']'
++ echo 'dist-upgrade -d -y -o APT::Get::Show-Upgraded=true'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=e647be386a7d1853e0e4b05248391d8e
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-e647be386a7d1853e0e4b05248391d8e ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-e647be386a7d1853e0e4b05248391d8e /tmp/cron-apt.X5DFeL/temp
+ cp /tmp/cron-apt.X5DFeL/temp /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-e647be386a7d1853e0e4b05248391d8e
+ '[' -n /tmp/cron-apt.X5DFeL/difftemp ']'
+ '[' -r /tmp/cron-apt.X5DFeL/difftemp ']'
+ '[' prepend = only ']'
+ '[' prepend = append ']'
+ '[' prepend = prepend ']'
+ echo '----- DIFF END HERE -----'
+ cat /tmp/cron-apt.X5DFeL/temp
+ mv /tmp/cron-apt.X5DFeL/difftemp /tmp/cron-apt.X5DFeL/temp
+ '[' upgrade = changes ']'
+ '[' always = changes ']'
+ '[' verbose = changes ']'
+ rm -f /tmp/cron-apt.X5DFeL/difftemp
+ read LINE
+ '[' -e /tmp/cron-apt.X5DFeL/status ']'
+ herevariables_restore
+ general_varmove STORED ''
+ PREFIX=STORED
+ STORE=
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_STORED='
++ sed -e 's|=.*||;'
+ LIST=
+ onexit
+ '[' -f /tmp/cron-apt.X5DFeL/initlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/temp ']'
+ rm -f /tmp/cron-apt.X5DFeL/temp
+ '[' -f /tmp/cron-apt.X5DFeL/actionlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionmail ']'
+ '[' -f /tmp/cron-apt.X5DFeL/actionerror ']'
+ rm -f /tmp/cron-apt.X5DFeL/actionerror
+ '[' -f /tmp/cron-apt.X5DFeL/runlog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runsyslog ']'
+ '[' -f /tmp/cron-apt.X5DFeL/runerror ']'
+ rm -f /tmp/cron-apt.X5DFeL/runerror
+ '[' -f /tmp/cron-apt.X5DFeL/runmail ']'
+ '[' -f /tmp/cron-apt.X5DFeL/mail ']'
+ '[' upgrade '!=' never ']'
+ '[' -n upgrade ']'
+ HDR='To: administrator@fsmuw.rwth-aachen.de'
+ '[' -z '' ']'
++ uname -n
+ HOSTNAME=ts
+ '[' -f /tmp/cron-apt.X5DFeL/_-_etc_-_cron-apt_-_config-error ']'
++ printf 'To: administrator@fsmuw.rwth-aachen.de\nSubject: CRON-APT completed on ts [/etc/cron-apt/config]'
+ HDR='To: administrator@fsmuw.rwth-aachen.de
Subject: CRON-APT completed on ts [/etc/cron-apt/config]'
+ i=1
+ eval 'VAL=${XHEADER1}'
++ VAL=
+ '[' '!' -z '' ']'
+ umask 022
+ printf 'To: administrator@fsmuw.rwth-aachen.de
Subject: CRON-APT completed on ts [/etc/cron-apt/config]\n\n'
+ fold --spaces --width=900 /tmp/cron-apt.X5DFeL/mail
+ command -v sendmail
+ sendmail -t -oi
+ rm -f /tmp/cron-apt.X5DFeL/mail
+ '[' -f /tmp/cron-apt.X5DFeL/_-_etc_-_cron-apt_-_config-error ']'
+ '[' -d /tmp/cron-apt.X5DFeL ']'
+ rmdir /tmp/cron-apt.X5DFeL
+ '[' -x /usr/bin/dotlockfile ']'
+ dotlockfile -u /var/lib/cron-apt/lockfile

Am Dienstag, 24. Januar 2023 09:16 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Hi Richard Strange!

Can you try to copy cron-apt and comment this:if [ -t 0 ]; then
    RUNIMMEDIATELY="yes"
fi

And then run manually.

bash -x your-cron-apt-copyIt would help to understand what happens. // Ola On Mon, 23 Jan 2023 at 23:30, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:Hi,
sleep 456 and sleep 1200 work without any problems. Also, I don't have any special kernel. Currently, Output of uname -a is "Linux ts 6.1.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.4-1 (2023-01-07) x86_64 GNU/Linux". I don't even have any other repository active other than the typical Debian ones (testing, testing-updates, testing-backports, testing-security).

Also, I'm noticing cron-apt becoming less reliable in the last weeks (I actually wanted to report this before Christmas, but something must have went wrong so I only got the email, but it probably was never sent to the bugreport mailing list). It used to reliably send mails every day at which it finds any updates. But in the last weeks, it mostly doesn't do that anymore. The log in journalctl/syslog always shows the same text (only difference in the checksum and so on). RUNSLEEP has been commented out for weeks now.

Richard

Am Montag, 23. Januar 2023 22:10 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Hi When you run cron-apt from a terminal RUNSLEEP is not used. This is why it works when running manually.

Please try running the following in a command

sleep 456

or any large number for sleep.

Do you have some special kernel? The kernel should not give that problem.

cron-apt do not do anything magic. It just executes sleep

It could also be that it is not the sleep command itself. It could be the random number generation done a few lines earlier in that script. // Ola On Wed, 18 Jan 2023 at 15:12, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:Package: cron-apt
Version: 0.13.0.1
Severity: important
X-Debbugs-Cc: submit@bugs.debian.org

Dear Maintainer,
when running cron-apt as shipped it works normal, running at 4 am and sending an email when anything can be updated. But when adding the recommended RUNSLEEP variable to the config, the only thing that happens is throwing a kernel error at 4 am:

     2022-12-19T04:00:01.425628+01:00 ts CRON[75874]: (root) CMD (test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt)
     2022-12-19T04:00:01.468596+01:00 ts kernel: [276052.628108] traps: cksum[75885] trap invalid opcode ip:562d9fe03cf5 sp:7ffd9b53fe20 error:0 in cksum[562d9fded000+17000]
     2022-12-19T04:00:02.525060+01:00 ts sSMTP[75887]: Sent mail for root@ts.domain.de (221 mailserver.de) uid=0 username=root outbytes=691

Even though it says a mail is sent, it's not received. Since cron-apt clearly doesn't run at all, that might be the reason. Running cron-apt manually with RUNSLEEP set with "cron-apt -s" works without problems.

#1029140#30
Date:
2023-01-24 15:44:46 UTC
From:
To:
Did you get that kernel error?

Den tis 24 jan. 2023 14:12Richard Rosner <rrosner@fsmuw.rwth-aachen.de>
skrev:

#1029140#35
Date:
2023-01-24 16:06:38 UTC
From:
To:
No, and it did send a mail.
#1029140#40
Date:
2023-01-24 18:00:12 UTC
From:
To:
Argh!

Can you run it with bash -x from cron? Hopefully it tells where it breaks

Den tis 24 jan. 2023 17:06Richard Rosner <rrosner@fsmuw.rwth-aachen.de>
skrev:

#1029140#45
Date:
2023-01-26 14:12:28 UTC
From:
To:
With RUNSLEEP disabled, I get
2023-01-26T04:00:01.178308+01:00 ts CRON[60845]: (root) CMD (bash -x test -x /usr/sbin/cron-apt && bash -x /usr/sbin/cron-apt)
2023-01-26T04:00:02.235676+01:00 ts sSMTP[60847]: Sent mail for root@ts.domain.de (221 mailserver.de) uid=0 username=root outbytes=672

No kernel errors. I didn't receive a mail about updates, though, but I also don't know the time the server I get the updates from updates its repository the last time.

With RUNSLEEP set to 3600 I get the same (running with no delay). And even though I did run apt update between these two runs (28 updates available) I didn't receive the mail.
​​​​​​
Richard


Am Dienstag, 24. Januar 2023 19:00 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Argh! Can you run it with bash -x from cron? Hopefully it tells where it breaks  Den tis 24 jan. 2023 17:06Richard Rosner <rrosner@fsmuw.rwth-aachen.de> skrev:No, and it did send a mail.

#1029140#50
Date:
2023-01-26 23:18:13 UTC
From:
To:
Hi Richard

I thought you would get the cron output from bash -x in an email so I could
see more what happens. It should be sent to the root user. Or have
you redirected those emails so you do not get them?

Sorry for not being clear on that.

Best regards

// Ola

On Thu, 26 Jan 2023 at 15:15, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:

#1029140#55
Date:
2023-01-27 06:20:23 UTC
From:
To:
They are supposed to be sent to the mail address defined in the cron-apt config. It didn't arrive there. Or did the change of executing cron-apt change anything about that?

Richard

#1029140#60
Date:
2023-01-27 06:45:27 UTC
From:
To:
Hi Richard

It is a different email I'm referring to. When a script, run by
cron, prints something on standard output that will be sent to the root
user as an email. At least in standard configuration.
You should therefore have received two emails. One from cron-apt itself. We
know that will not arrive due to this problem. The other email should also
be sent by cron itself, but that do not seem to arrive either. Strange.

Can you change the line in cron so it outputs stdout and stderr to a file
instead?

// Ola

On Fri, 27 Jan 2023 at 07:20, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:

#1029140#65
Date:
2023-01-27 12:16:45 UTC
From:
To:
Oddly enough, that doesn't work. I already did set the MAILTO directive so I should get the mail. But even after changing it to
*/5 * * * * root bash -x test -x /usr/sbin/cron-apt && bash -x /usr/sbin/cron-apt > /root/cron-apt.log 2>&1nothing is being written to the mentioned file. File permissions are 644, owned by root. journalctl does list the execution of the cron job, but nothing else, no errors.

Richard

Am Freitag, 27. Januar 2023 07:45 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Hi Richard It is a different email I'm referring to. When a script, run by cron, prints something on standard output that will be sent to the root user as an email. At least in standard configuration.You should therefore have received two emails. One from cron-apt itself. We know that will not arrive due to this problem. The other email should also be sent by cron itself, but that do not seem to arrive either. Strange. Can you change the line in cron so it outputs stdout and stderr to a file instead? // Ola  On Fri, 27 Jan 2023 at 07:20, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:They are supposed to be sent to the mail address defined in the cron-apt config. It didn't arrive there. Or did the change of executing cron-apt change anything about that?

Richard On January 27, 2023 12:18:13 AM GMT+01:00, Ola Lundqvist <ola@inguza.com> wrote:Hi Richard I thought you would get the cron output from bash -x in an email so I could see more what happens. It should be sent to the root user. Or have you redirected those emails so you do not get them? Sorry for not being clear on that. Best regards // Ola On Thu, 26 Jan 2023 at 15:15, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:With RUNSLEEP disabled, I get
2023-01-26T04:00:01.178308+01:00 ts CRON[60845]: (root) CMD (bash -x test -x /usr/sbin/cron-apt && bash -x /usr/sbin/cron-apt)
2023-01-26T04:00:02.235676+01:00 ts sSMTP[60847]: Sent mail for root@ts.domain.de (221 mailserver.de) uid=0 username=root outbytes=672

No kernel errors. I didn't receive a mail about updates, though, but I also don't know the time the server I get the updates from updates its repository the last time.

With RUNSLEEP set to 3600 I get the same (running with no delay). And even though I did run apt update between these two runs (28 updates available) I didn't receive the mail.
​​​​​​
Richard


Am Dienstag, 24. Januar 2023 19:00 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Argh! Can you run it with bash -x from cron? Hopefully it tells where it breaks  Den tis 24 jan. 2023 17:06Richard Rosner <rrosner@fsmuw.rwth-aachen.de> skrev:No, and it did send a mail.

#1029140#70
Date:
2023-01-28 14:23:02 UTC
From:
To:
Really strange!

Not sure what could be wrong here.

// Ola

On Fri, 27 Jan 2023 at 13:17, Richard Rosner <rrosner@fsmuw.rwth-aachen.de> wrote:

#1029140#75
Date:
2023-01-30 14:02:14 UTC
From:
To:
I now found the problem. The mails from cron had been sorted into spam because they had "root (Cron Daemon)" as sender and rspamd didn't like the sender domain to be forged to root@domain.de. Anyway, the error message says "/usr/bin/test: /usr/bin/test: can't execute file". I guess it didn't like to be executed by bash -x. I set the cron-apt entry to "test -x /usr/sbin/cron-apt && bash -x /usr/sbin/cron-apt > /root/cron-apt.log 2>&1", this works now. Output to the log file is:
+ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+ UMASK_TIGHT=077
+ UMASK_APT=022
+ umask 077
+ STDOUT=
+ ALLCONFIGS=
+ '[' -n '' ']'
+ '[' -z '' ']'
+ CONFIG=/etc/cron-apt/config
+ ALLCONFIGS=/etc/cron-apt/config
+ LIBDIR=/var/lib/cron-apt
+ SHAREDIR=/usr/share/cron-apt
++ echo /etc/cron-apt/config
++ sed 's|/|_-_|g'
+ CONFIGDIRNAME=_-_etc_-_cron-apt_-_config
++ mktemp -d -t cron-apt.XXXXXX
+ TMPDIR=/tmp/cron-apt.rAN9JY
+ '[' 0 -ne 0 ']'
+ INITLOG=/tmp/cron-apt.rAN9JY/initlog
+ RUNERROR=/tmp/cron-apt.rAN9JY/runerror
+ RUNSYSLOG=/tmp/cron-apt.rAN9JY/runsyslog
+ RUNLOG=/tmp/cron-apt.rAN9JY/runlog
+ RUNMAIL=/tmp/cron-apt.rAN9JY/runmail
+ ACTIONERROR=/tmp/cron-apt.rAN9JY/actionerror
+ ACTIONSYSLOG=/tmp/cron-apt.rAN9JY/actionsyslog
+ ACTIONLOG=/tmp/cron-apt.rAN9JY/actionlog
+ ACTIONMAIL=/tmp/cron-apt.rAN9JY/actionmail
+ TEMP=/tmp/cron-apt.rAN9JY/temp
+ MAIL=/tmp/cron-apt.rAN9JY/mail
+ DIFF=/tmp/cron-apt.rAN9JY/difftemp
+ STATUS=/tmp/cron-apt.rAN9JY/status
+ LOCKFILE=/var/lib/cron-apt/lockfile
+ MAILCHDIR=/var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges
+ ERROR=/tmp/cron-apt.rAN9JY/_-_etc_-_cron-apt_-_config-error
+ ACTIONDIR=/etc/cron-apt/action.d
+ ACTIONCONFDIR=/etc/cron-apt/config.d
+ MAILMSGDIR=/etc/cron-apt/mailmsg.d
+ MAILONMSGSDIR=/etc/cron-apt/mailonmsgs
+ SYSLOGONMSGSDIR=/etc/cron-apt/syslogonmsgs
+ REFRAINFILE=/etc/cron-apt/refrain
+ NOLOCKWARN=
+ ERRORMSGDIR=/etc/cron-apt/errormsg.d
+ SYSLOGMSGDIR=/etc/cron-apt/syslogmsg.d
+ LOGMSGDIR=/etc/cron-apt/logmsg.d
+ LOGDIR=/var/log/cron-apt
+ LOG=/var/log/cron-apt/log
+ LASTFULLMESSAGE=/var/log/cron-apt/lastfullmessage
+ DIFFONCHANGES=prepend
+ SUBJECTPREFIX=CRON-APT
+ MAILTO=root
+ MAILWIDTH=900
+ SYSLOGON=upgrade
+ MAILON=error
+ EXITON=error
+ DEBUG=verbose
+ OPTIONS='-o quiet=1'
+ DONTRUN=
+ RUNSLEEP=3600
+ MINTMPDIRSIZE=10
+ APTCOMMAND=/usr/bin/apt-get
+ HOSTNAME=
+ DIFFIGNORE=
+ DIFFONCHANGES=prepend
+ export DEBIAN_FRONTEND=noninteractive
+ DEBIAN_FRONTEND=noninteractive
+ export LANG=C
+ LANG=C
+ export LC_ALL=C
+ LC_ALL=C
+ for cfg in $ALLCONFIGS
+ '[' -f /etc/cron-apt/config ']'
+ . /etc/cron-apt/config
++ APTCOMMAND=/usr/bin/apt-get
++ MAILTO=administrator@fsmuw.rwth-aachen.de
++ MAILON=upgrade
++ RUNSLEEP=3600
++ SYSLOGON=always
+ '[' -t 0 ']'
+ test '' = yes
+ . /usr/share/cron-apt/functions
+ '[' -d /var/lib/cron-apt/_-_etc_-_cron-apt_-_config ']'
+ '[' -d /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges ']'
+ '[' -e /etc/cron-apt/refrain ']'
+ checktmpsize
++ stat --file-system --format=%S /tmp/cron-apt.rAN9JY
+ SSIZE=4096
++ stat --file-system --format=%a /tmp/cron-apt.rAN9JY
+ FSCOUNT=1021392
+ '[' 1021392 -lt 33554432 ']'
+ '[' 4085568 -lt 10 ']'
++ date
+ echo 'CRON-APT RUN [/etc/cron-apt/config]: Mon Jan 30 13:00:01 CET 2023'
+ '[' -n 3600 ']'
+ '[' 3600 -gt 0 ']'
+ '[' -z 9590 ']'
+ TIME=450
+ sleep 450
++ date
+ echo 'CRON-APT SLEEP: 450, Mon Jan 30 13:07:31 CET 2023'
+ '[' -e /etc/cron-apt/refrain ']'
+ checktmpsize
++ stat --file-system --format=%S /tmp/cron-apt.rAN9JY
+ SSIZE=4096
++ stat --file-system --format=%a /tmp/cron-apt.rAN9JY
+ FSCOUNT=1021391
+ '[' 1021391 -lt 33554432 ']'
+ '[' 4085564 -lt 10 ']'
+ '[' -x /usr/bin/dotlockfile ']'
+ dotlockfile -l -p -r 10 /var/lib/cron-apt/lockfile
+ cp /tmp/cron-apt.rAN9JY/initlog /tmp/cron-apt.rAN9JY/runmail
+ cp /tmp/cron-apt.rAN9JY/initlog /tmp/cron-apt.rAN9JY/runlog
+ cp /tmp/cron-apt.rAN9JY/initlog /tmp/cron-apt.rAN9JY/runsyslog
+ cp /tmp/cron-apt.rAN9JY/initlog /tmp/cron-apt.rAN9JY/runerror
+ rm -f /tmp/cron-apt.rAN9JY/initlog
++ run_parts /etc/cron-apt/action.d
++ unset LANG LC_COLLATE LC_ALL
++ '[' -z /etc/cron-apt/action.d ']'
++ '[' '!' -d /etc/cron-apt/action.d ']'
+++ ls /etc/cron-apt/action.d
++ for F in $(ls $1)
++ expr '#0-update#' : '[[:alnum:]_-]\+$'
++ for F in $(ls $1)
++ expr 0-update : '[[:alnum:]_-]\+$'
++ '[' -f /etc/cron-apt/action.d/0-update ']'
++ echo /etc/cron-apt/action.d/0-update
++ for F in $(ls $1)
++ expr 3-download : '[[:alnum:]_-]\+$'
++ '[' -f /etc/cron-apt/action.d/3-download ']'
++ echo /etc/cron-apt/action.d/3-download
+ for ACTION in $(run_parts "$ACTIONDIR")
++ echo /etc/cron-apt/action.d/0-update
++ sed 's|/etc/cron-apt/action.d/||'
+ ACTIONF=0-update
+ '[' -f /etc/cron-apt/config.d/0-update ']'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ echo 'CRON-APT ACTION: 0-update'
+ herevariables_store
+ general_varmove HERE STORED
+ PREFIX=HERE
+ STORE=STORED
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_HERE='
++ sed -e 's|=.*||;'
+ LIST=
+ cat /etc/cron-apt/action.d/0-update
+ sed -e 's/#.*$//;'
+ grep -v '^[[:space:]]*$'
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 update -o quiet=2'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 update -o quiet=2
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.rAN9JY/temp
+ '[' always = always ']'
+ createsysloginfo 0-update
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/syslogmsg.d/0-update /tmp/cron-apt.rAN9JY/runsyslog /tmp/cron-apt.rAN9JY/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/0-update
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/0-update ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/0-update ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runsyslog ']'
+ tomsg /tmp/cron-apt.rAN9JY/runsyslog syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/runsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/runsyslog
+ rm -f /tmp/cron-apt.rAN9JY/runsyslog
+ '[' -n /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ tomsg /tmp/cron-apt.rAN9JY/actionsyslog syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/actionsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/actionsyslog
+ rm -f /tmp/cron-apt.rAN9JY/actionsyslog
+ tomsg /tmp/cron-apt.rAN9JY/temp syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 0-update
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/logmsg.d/0-update /tmp/cron-apt.rAN9JY/runlog /tmp/cron-apt.rAN9JY/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/0-update
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runlog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/0-update ']'
+ '[' -f /etc/cron-apt/logmsg.d/0-update ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runlog ']'
+ tomsg /tmp/cron-apt.rAN9JY/runlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/runlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/runlog
+ rm -f /tmp/cron-apt.rAN9JY/runlog
+ '[' -n /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionlog ']'
+ tomsg /tmp/cron-apt.rAN9JY/actionlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/actionlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/actionlog
+ rm -f /tmp/cron-apt.rAN9JY/actionlog
+ tomsg /tmp/cron-apt.rAN9JY/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.rAN9JY/temp
++ echo 'update -o quiet=2'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=bd7e303bb529e32e21411dab0e365376
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/0-update-bd7e303bb529e32e21411dab0e365376 ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/0-update-bd7e303bb529e32e21411dab0e365376 /tmp/cron-apt.rAN9JY/temp
+ rm -f /tmp/cron-apt.rAN9JY/difftemp
+ read LINE
+ '[' -e /tmp/cron-apt.rAN9JY/status ']'
+ herevariables_restore
+ general_varmove STORED ''
+ PREFIX=STORED
+ STORE=
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_STORED='
++ sed -e 's|=.*||;'
+ LIST=
+ for ACTION in $(run_parts "$ACTIONDIR")
++ echo /etc/cron-apt/action.d/3-download
++ sed 's|/etc/cron-apt/action.d/||'
+ ACTIONF=3-download
+ '[' -f /etc/cron-apt/config.d/3-download ']'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ echo 'CRON-APT ACTION: 3-download'
+ herevariables_store
+ general_varmove HERE STORED
+ PREFIX=HERE
+ STORE=STORED
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_HERE='
++ sed -e 's|=.*||;'
+ LIST=
+ cat /etc/cron-apt/action.d/3-download
+ sed -e 's/#.*$//;'
+ grep -v '^[[:space:]]*$'
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 autoclean -y'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 autoclean -y
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.rAN9JY/temp
+ '[' always = always ']'
+ createsysloginfo 3-download
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/syslogmsg.d/3-download /tmp/cron-apt.rAN9JY/runsyslog /tmp/cron-apt.rAN9JY/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -n /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ tomsg /tmp/cron-apt.rAN9JY/actionsyslog syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/actionsyslog
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/actionsyslog
+ rm -f /tmp/cron-apt.rAN9JY/actionsyslog
+ tomsg /tmp/cron-apt.rAN9JY/temp syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 3-download
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/logmsg.d/3-download /tmp/cron-apt.rAN9JY/runlog /tmp/cron-apt.rAN9JY/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runlog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -n /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionlog ']'
+ tomsg /tmp/cron-apt.rAN9JY/actionlog /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/actionlog
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -r /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/actionlog
+ rm -f /tmp/cron-apt.rAN9JY/actionlog
+ tomsg /tmp/cron-apt.rAN9JY/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.rAN9JY/temp
+ '[' always = output ']'
+ '[' upgrade = output ']'
+ '[' verbose = upgrade ']'
++ echo 'autoclean -y'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=58797c9195c34287e12120e4b46fb611
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-58797c9195c34287e12120e4b46fb611 ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-58797c9195c34287e12120e4b46fb611 /tmp/cron-apt.rAN9JY/temp
+ rm -f /tmp/cron-apt.rAN9JY/difftemp
+ read LINE
+ echo 'CRON-APT LINE: /usr/bin/apt-get -o quiet=1 dist-upgrade -d -y -o APT::Get::Show-Upgraded=true'
++ umask
+ UMASK_SAVE=0077
+ umask 022
+ /usr/bin/apt-get -o quiet=1 dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
+ RET=0
+ umask 0077
+ '[' 0 -ne 0 ']'
+ grep -q 'The following packages will be upgraded' /tmp/cron-apt.rAN9JY/temp
+ '[' always = always ']'
+ createsysloginfo 3-download
+ '[' -n always ']'
+ '[' -f /etc/cron-apt/syslogonmsgs/always ']'
+ createdivinfo syslog /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/syslogmsg.d/3-download /tmp/cron-apt.rAN9JY/runsyslog /tmp/cron-apt.rAN9JY/actionsyslog
+ FILE=syslog
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/syslogmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runsyslog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionsyslog
+ TMPSTDOUT=
+ '[' syslog '!=' syslog ']'
+ '[' -n /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/syslogmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -n /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ tomsg /tmp/cron-apt.rAN9JY/temp syslog ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=syslog
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' syslog '!=' syslog ']'
+ logger -p user.notice -t cron-apt -f /tmp/cron-apt.rAN9JY/temp
+ '[' upgrade = always ']'
+ '[' verbose = verbose ']'
+ createloginfo 3-download
+ createdivinfo /var/log/cron-apt/log /tmp/cron-apt.rAN9JY/temp /etc/cron-apt/logmsg.d/3-download /tmp/cron-apt.rAN9JY/runlog /tmp/cron-apt.rAN9JY/actionlog ''
+ FILE=/var/log/cron-apt/log
+ CAT=/tmp/cron-apt.rAN9JY/temp
+ OPTCAT=/etc/cron-apt/logmsg.d/3-download
+ OPTRUNCAT=/tmp/cron-apt.rAN9JY/runlog
+ OPTACTIONCAT=/tmp/cron-apt.rAN9JY/actionlog
+ TMPSTDOUT=
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ touch /var/log/cron-apt/log
+ '[' -n /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -f /etc/cron-apt/logmsg.d/3-download ']'
+ '[' -n /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -n /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionlog ']'
+ tomsg /tmp/cron-apt.rAN9JY/temp /var/log/cron-apt/log ''
+ TCAT=/tmp/cron-apt.rAN9JY/temp
+ TFILE=/var/log/cron-apt/log
+ TSTD=
+ '[' -n /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -r /tmp/cron-apt.rAN9JY/temp ']'
+ '[' -n '' ']'
+ '[' /var/log/cron-apt/log '!=' syslog ']'
+ cat /tmp/cron-apt.rAN9JY/temp
+ grep -qvE '^[[:space:]]*$|CRON-APT' /tmp/cron-apt.rAN9JY/temp
+ '[' always = output ']'
+ '[' upgrade = output ']'
+ '[' verbose = upgrade ']'
++ echo 'dist-upgrade -d -y -o APT::Get::Show-Upgraded=true'
++ md5sum
++ sed -e 's/[[:space:]].*//;'
+ TLINE=e647be386a7d1853e0e4b05248391d8e
+ '[' -n '' ']'
+ echo 'CRON-APT DIFF'
+ '[' '!' -r /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-e647be386a7d1853e0e4b05248391d8e ']'
+ diff -u /var/lib/cron-apt/_-_etc_-_cron-apt_-_config/mailchanges/3-download-e647be386a7d1853e0e4b05248391d8e /tmp/cron-apt.rAN9JY/temp
+ rm -f /tmp/cron-apt.rAN9JY/difftemp
+ read LINE
+ '[' -e /tmp/cron-apt.rAN9JY/status ']'
+ herevariables_restore
+ general_varmove STORED ''
+ PREFIX=STORED
+ STORE=
+ SIFS='     
'
++ set
++ grep '^[a-zA-Z][a-zA-Z0-9_]*_STORED='
++ sed -e 's|=.*||;'
+ LIST=
+ onexit
+ '[' -f /tmp/cron-apt.rAN9JY/initlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/temp ']'
+ rm -f /tmp/cron-apt.rAN9JY/temp
+ '[' -f /tmp/cron-apt.rAN9JY/actionlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/actionmail ']'
+ rm -f /tmp/cron-apt.rAN9JY/actionmail
+ '[' -f /tmp/cron-apt.rAN9JY/actionerror ']'
+ rm -f /tmp/cron-apt.rAN9JY/actionerror
+ '[' -f /tmp/cron-apt.rAN9JY/runlog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runsyslog ']'
+ '[' -f /tmp/cron-apt.rAN9JY/runerror ']'
+ rm -f /tmp/cron-apt.rAN9JY/runerror
+ '[' -f /tmp/cron-apt.rAN9JY/runmail ']'
+ rm -f /tmp/cron-apt.rAN9JY/runmail
+ '[' -f /tmp/cron-apt.rAN9JY/mail ']'
+ '[' -f /tmp/cron-apt.rAN9JY/_-_etc_-_cron-apt_-_config-error ']'
+ '[' -d /tmp/cron-apt.rAN9JY ']'
+ rmdir /tmp/cron-apt.rAN9JY
+ '[' -x /usr/bin/dotlockfile ']'
+ dotlockfile -u /var/lib/cron-apt/lockfile
 
Richard

Am Samstag, 28. Januar 2023 15:23 CET, schrieb Ola Lundqvist <ola@inguza.com>:
 Really strange! Not sure what could be wrong here. // Ola  -- --- Inguza Technology AB --- MSc in Information Technology ----|  ola@inguza.com                    opal@debian.org            ||  http://inguza.com/                Mobile: +46 (0)70-332 1551 | --------------------------------------------------------------- 

#1029140#80
Date:
2023-01-31 13:55:53 UTC
From:
To:
Thank you. According to the log everything works fine. Did it work fine now?

If possible attach the file as an attachment and the syslog where you have
the kernel error log.

// Ola

#1029140#85
Date:
2024-05-15 08:36:17 UTC
From:
To:
Using bash will not help here, that's the problem. cron-apt is a /bin/sh
script, and on many systems /bin/sh is dash. And, $RANDOM doesn't exist
in dash.

Change cron-apt's shebang line to use /bin/bash and it should be fine.

Now we probably can move on to stage 6 of debugging "how did that
ever work?", since we're having /bin/sh point to dash for a while and
this issue just appeared on of my _stable_ systems.

Greetings
Marc

#1029140#88
Date:
2024-05-15 08:36:17 UTC
From:
To:
Using bash will not help here, that's the problem. cron-apt is a /bin/sh
script, and on many systems /bin/sh is dash. And, $RANDOM doesn't exist
in dash.

Change cron-apt's shebang line to use /bin/bash and it should be fine.

Now we probably can move on to stage 6 of debugging "how did that
ever work?", since we're having /bin/sh point to dash for a while and
this issue just appeared on of my _stable_ systems.

Greetings
Marc

#1029140#93
Date:
2024-06-10 21:02:30 UTC
From:
To:
Hi Marc

Sorry, I meant to run with dash -x. Or do dash not have that option?

Cheers

// Ola

#1029140#96
Date:
2024-06-10 21:02:30 UTC
From:
To:
Hi Marc

Sorry, I meant to run with dash -x. Or do dash not have that option?

Cheers

// Ola

#1029140#101
Date:
2024-06-11 13:52:46 UTC
From:
To:
It has this option.

But I see a problem in cron-apt using bashisms while using the /bin/sh
shebang line. I don't know whether this have to do with this, bug, but
it should be fixed anyway.

Greetings
Marc

#1029140#104
Date:
2024-06-11 13:52:46 UTC
From:
To:
It has this option.

But I see a problem in cron-apt using bashisms while using the /bin/sh
shebang line. I don't know whether this have to do with this, bug, but
it should be fixed anyway.

Greetings
Marc

#1029140#109
Date:
2024-06-11 18:12:27 UTC
From:
To:
Hi Marc

Certainly. If you know those I'm happy to fix them.

I thought I had fixed them all already.

Cheers

// Ola

#1029140#112
Date:
2024-06-11 18:12:27 UTC
From:
To:
Hi Marc

Certainly. If you know those I'm happy to fix them.

I thought I had fixed them all already.

Cheers

// Ola

#1029140#117
Date:
2024-06-11 19:35:38 UTC
From:
To:
The one that jumped to my mind is $RANDOM which doesnt work in dash.

I would recommend just using /bin/bash in the shebang line. At least
that's what I do since I'd rather not delve into those shell details too
deeply.

Greetings
Marc

#1029140#120
Date:
2024-06-11 19:35:38 UTC
From:
To:
The one that jumped to my mind is $RANDOM which doesnt work in dash.

I would recommend just using /bin/bash in the shebang line. At least
that's what I do since I'd rather not delve into those shell details too
deeply.

Greetings
Marc