Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#4573 - Weird cron emails

Attached to Project: Arch Linux
Opened by David Rosenstrauch (darose) - Friday, 05 May 2006, 13:39 GMT
Last edited by Dale Blount (dale) - Monday, 19 June 2006, 19:11 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Low
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As detailed in this email thread:

http://www.archlinux.org/pipermail/arch/2006-March/009292.html

cron is sending out emails nightly that read like this:

From: "root"
Subject: cron: /usr/sbin/run-cron /etc/cron.daily
Body: %G

---

According to Judd's email, this is an issue in /etc/profile.d/locale.sh. That script is echoing those characters in an attempt to set the console to use unicode. However, this is winding up getting executed on scripts as well, not just tty consoles.

The locale.sh should be changed to only perform this setting if the console is a tty.
This task depends upon

Closed by  Judd Vinet (judd)
Thursday, 28 September 2006, 19:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  Added for next build -- thanks guys.
Comment by Rumcajs Lasowy (Rumcajs) - Friday, 05 May 2006, 22:23 GMT
i can confirm this i get this daily cron "spam" to :

From: root
Subject: cron: /usr/sbin/run-cron /etc/cron.daily
Body: (K

Comment by David Rosenstrauch (darose) - Monday, 05 June 2006, 13:37 GMT
I know this is a low priority task, but it'd be great if someone could take a look at this. It's probably very easy to fix, and it's rather annoying.
Comment by Dale Blount (dale) - Monday, 19 June 2006, 19:12 GMT
I'm getting them too on new installs. It has something to do with the default being utf8 now instead of whatever it was before. +1 on the annoyingness.
Comment by David Rosenstrauch (darose) - Monday, 07 August 2006, 02:37 GMT
Any update on this? Again, I know it's minor, but it is annoying.
Comment by Gabriel Linder (raskolnikov) - Friday, 18 August 2006, 07:24 GMT
I have found yesterday a solution to this annoying thing. Scripts launched by cron have a variable CONSOLE defined, so you can add a test like this :

if [ "$CONSOLE" == "" ]; then
# script run from terminal, execute locale settings or whatever you not want to run with cron
fi

No more junks mails (the same applies if you wrote a fortune script in profile.d, no more fortunes in your mails) :)
Please note that the locale.sh is regenerated by boot scripts, so you may want to patch them instead of this file directly.
Comment by David Rosenstrauch (darose) - Monday, 28 August 2006, 04:54 GMT
Problem is, though, these aren't my own scripts that are sending these messages. I'm surmising from the subject of the emails I'm getting that it's one of the scripts in /etc/cron.daily that's the culprit. There's 4 scripts in my /etc/cron.daily: logrotate, shadow, updatedb, and whatis. Anyone have any idea which of these needs to have the above fix applied?
Comment by Gabriel Linder (raskolnikov) - Saturday, 02 September 2006, 23:18 GMT
The /etc/profile.d/locale.sh script is the cause of the emails (it's sourced when scripts are executed).
Please see my previously attached file (rasko_locale.sh) for a fix...
Comment by David Rosenstrauch (darose) - Wednesday, 06 September 2006, 13:31 GMT
OK, I understand now. I didn't understand what you were saying at first. And yes, that worked.

But like you said, /etc/profile.d/locale.sh gets regenerated (by /etc/rc.sysinit) on every boot. So this really needs to get fixed via a patch to the initscripts package.

Judd, can you apply the following patch so we can close out this bug?

--- /tmp/rc.sysinit 2006-09-06 09:31:00.000000000 -0400
+++ /etc/rc.sysinit 2006-07-07 11:00:20.000000000 -0400
@@ -241,7 +241,7 @@
stat_busy "Setting Consoles to UTF-8"
/usr/bin/kbd_mode -u
/usr/bin/dumpkeys | /bin/loadkeys --unicode
- echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a isatty ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh
+ echo 'if [ "$TERM" = "linux" -a isatty ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh
stat_done
fi
fi
@@ -254,7 +254,7 @@
/usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}
fi
done
- echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a isatty ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh
+ echo 'if [ "$TERM" = "linux" -a isatty ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh
stat_done
fi

Loading...