Package: cron-apt
Version: 0.4.14
Severity: normal
Tags: patch
I have several chroot systems on the same machine. When mail is sent
from the machine from several of the chroots plus the supervisor
system itself I could not tell which chroot the messages were coming
from. I browsed the cron-apt script and I see that there appears to
be provision to add a header message to mail and syslog if it is
available. Placing a file /etc/cron-apt/mailonmsgs/upgrade with
appropriate contents seems to be the intention.
But the current set of variables names do not match. The variables
are "MAILONMSGSDIR" ("MAIL <<ON>> MSGSDIR") and SYSLOGONMSGSDIR versus
versions without the ON in the middle.
MAILONMSGSDIR="/etc/cron-apt/mailonmsgs"
SYSLOGONMSGSDIR="/etc/cron-apt/syslogonmsgs"
...
createmailinfo() {
touch "$MAIL"
if [ -n "$MAILON" ] && [ -f "$MAILMSGSDIR/$MAILON" ] ; then
cat "$MAILMSGSDIR/$MAILON" >> "$MAIL"
fi
createdivinfo "$MAIL" "$TEMP" "$MAILMSGDIR/$1" "$RUNMAIL" "$ACTIONMAIL"
}
# ACTIONF as first argument
createsysloginfo() {
if [ -n "$SYSLOGON" ] && [ -f "$SYSLOGMSGSDIR/$SYSLOGON" ] ; then
logger -p user.notice -t cron-apt -f "$SYSLOGMSGSDIR/$SYSLOGON"
fi
createdivinfo "syslog" "$TEMP" "$SYSLOGMSGDIR/$1" "$RUNSYSLOG"
"$ACTIONSYSLOG"
}
Here is the obvious patch to resolve this problem. With this change a
file /etc/cron-apt/mailonmsgs/upgrade will be prepended to the mail.
A workaround is for a local admin to put
MAILMSGSDIR=/etc/cron-apt/mailonmsgs
in the /etc/cron-apt/config.d/0-update file. This duplicates that
variable with the current spelling and it then works with the Etch
released version of the code.
Thanks
Bob
Index: cron-apt
===================================================================
--- cron-apt (revision 2429)
+++ cron-apt (working copy)
@@ -349,16 +349,16 @@
# ACTIONF as first argument
createmailinfo() {
touch "$MAIL"
- if [ -n "$MAILON" ] && [ -f "$MAILMSGSDIR/$MAILON" ] ; then
- cat "$MAILMSGSDIR/$MAILON" >> "$MAIL"
+ if [ -n "$MAILON" ] && [ -f "$MAILONMSGSDIR/$MAILON" ] ; then
+ cat "$MAILONMSGSDIR/$MAILON" >> "$MAIL"
fi
createdivinfo "$MAIL" "$TEMP" "$MAILMSGDIR/$1" "$RUNMAIL" "$ACTIONMAIL"
}
# ACTIONF as first argument
createsysloginfo() {
- if [ -n "$SYSLOGON" ] && [ -f "$SYSLOGMSGSDIR/$SYSLOGON" ] ; then
- logger -p user.notice -t cron-apt -f "$SYSLOGMSGSDIR/$SYSLOGON"
+ if [ -n "$SYSLOGON" ] && [ -f "$SYSLOGONMSGSDIR/$SYSLOGON" ] ; then
+ logger -p user.notice -t cron-apt -f "$SYSLOGONMSGSDIR/$SYSLOGON"
fi
createdivinfo "syslog" "$TEMP" "$SYSLOGMSGDIR/$1" "$RUNSYSLOG"
"$ACTIONSYSLOG"
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]