On Jan 3, 2014 4:08 AM, "Lars E. Pettersson" lars@homer.se wrote:
On 01/03/2014 05:07 AM, Pete Travis wrote:
I think there was some misunderstanding here. If you can't find your cronjob output in the journal, *your* cron is broken.
Default installation:
[root@tux ~]# rpm -V cronie [root@tux ~]# rpm -q cronie cronie-1.4.11-4.fc20.x86_64 [root@tux ~]# rpm -V crontabs [root@tux ~]# rpm -q crontabs crontabs-1.11-7.20130830git.fc20.noarch
Before I get too far in, in my opinion, mails are good for notification, voluminous content should be in the logs that the mail notifies about. The journal is good at logs.
Mail has no problem handling voluminous content. It is also very easy to
retrieve without knowing quite a lot of strange options to a command that you have to print in a terminal.
Yes, we know you prefer mail... Mail on the command line is exactly what you describe - it requires knowing esoteric command line options to an awkward terminal application. Two unfamiliar and clunky terminal applications for the purpose would be redundant, so one is gone.
$ journalctl SYSLOG_IDENTIFIER=CROND -f #filtered for convenience
Where is my output from yum-cron (yum-cron is run hourly and it has a
fault at the moment due to spots Chrome repository not yet being up to Fedora 20)?
[root@tux ~]# journalctl SYSLOG_IDENTIFIER=CROND --since=-2h -- Logs begin at Tue 2013-07-02 20:53:56 CEST, end at Fri 2014-01-03
11:40:01 CE
Jan 03 09:50:01 tux CROND[3666]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:00:01 tux CROND[3895]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:01:01 tux CROND[4044]: (root) CMD (run-parts /etc/cron.hourly) Jan 03 10:10:01 tux CROND[4358]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:20:01 tux CROND[5345]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:30:01 tux CROND[5521]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:40:01 tux CROND[5790]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 10:50:01 tux CROND[6135]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 11:00:01 tux CROND[6388]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 11:01:01 tux CROND[6541]: (root) CMD (run-parts /etc/cron.hourly) Jan 03 11:10:01 tux CROND[6763]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 11:20:01 tux CROND[6963]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 11:30:01 tux CROND[7380]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jan 03 11:40:01 tux CROND[7681]: (root) CMD (/usr/lib64/sa/sa1 1 1)
I see " CMD (run-parts /etc/cron.hourly", that could be where the magic happens. Maybe the output will show up with other filters, or it could be rewritten to use systemd-cat.
But wait! These things could get all mixed up on a busy machine, you say! Let's take a closer look at a message:
MESSAGE=(pete) CMDOUT (New Things are Different.)
[lots of lines removed]
SYSLOG_IDENTIFIER=CROND _CMDLINE=/usr/sbin/CROND -n _BOOT_ID=0557929cbde247928f945d8b53a6e067How is non technical user supposed to understand this? What command
sequence did you use to get that output?
A non-technical user would either understand by example - the part you cut out - or, they are a nontechnical user and have no interest in such things .
$ journalctl SYSLOG_IDENTIFIER=CROND _AUDIT_SESSION=83 -b
How do you find out the _AUDIT_SESSION to use?
I didn't guess. There was a straightforward and easy to follow example, but you removed it.
Stop! I don't want all that extra information, you say! `journalctl` should KNOW I'm not interested in the timestamp, or the hostname, or the name and PID of the reporting binary - just give me the message!
journalctl SYSLOG_IDENTIFIER=CROND _AUDIT_SESSION=83 -o cat (pete) CMD (LARSHAPPY="no"; if [[ "$LARSHAPPY" == "no" ]]; then echo -e "<This isn't the same.\nNew Th (pete) CMDOUT (This isn't the same.) (pete) CMDOUT (New Things are Different.) (pete) CMDOUT (Some people like the old thing.)
That is several messages. I want only one...
So what? If your entire complaint is "it isn't a mail" then send the mail and be done.
How am I notified that I should look in the journal when things go wrong?
(With mail I am notified and also get the "log" lines all at once)
How is a nontechnical desktop user notified of new mail? That's rhetorical, don't answer. They aren't .
I'll agree that this isn't as *simple* as banging out a four letter word and reading message, but the journal can provide context, too.
I am not arguing whether the journal is good or not, I am arguing whether
removing the MTA used to send mail, sent from some applications, is good or bad. As I see it, as long as some applications do send mail, we have to have a MTA. Or at least let those applications have a requirement of a MTA so that the MTA is installed when those applications are installed on the system. That is my key argument, not that the journal is bad.
The journal is OK, but very hard for a non technical user to use. What is
needed is probably a very good graphical frontend that hides all these strange things you show us in your mail. How is a non technical user supposed to understand all this?
OK, then, your argument is late and pointless. Appeal to fesco if you feel strongly about adding sendmail to the default installation, such decisions are not made on the user support list.
You're putting lots of effort into complaining about a hugely useful tool, and apparently little into learning about it. If the complaint is about cronjobs, start here:
I am not complaining about the journal. But please let us know where to
find a "journal for dummies" text where we can find out how to become journal experts. The man page is a bit sparse on information.
Of course, if you like the old way, you can just install and configure an MTA.
I have to as long as some applications use that path to send messages to
me. The same thing goes for all others installing these applications. Without a MTA these messages are lost in bit space.
Lars
More "I like using mail" ranting here. That's fine, use mail. I just wanted to point out how to use the journal, so I'm done here.
--Pete