Latest revision |
Your text |
Line 8: |
Line 8: |
| | | |
| ==Explanation== | | ==Explanation== |
− | On {{W|Unix}}-like systems, {{W|Cron|cron}} is a system utility that runs tasks on a schedule. This program has been around since the early days of Unix and has not changed much - it is still one of the most widely used functions in modern operating systems. Many administrative tasks on servers are automated using cron, including monitoring and updates.
| + | {{incomplete|More detailed explanation off Cron (with wiki links). Why would it break because of Cueball's action and what is the "etc/". Why would Cron "think" the e-mail is important? Title text not explained at all.}} |
| + | On Unix-like systems, cron is a background process which allows one to schedule jobs to run at well-defined time slots. When one of these jobs produces output, that output is sent as an email to the user, using the /usr/bin/sendmail program. A common situation on many unix-like systems is that sendmail (or the program implementing that binary, like exim or postfix) is not configured to send email to the actual email address of the person behind the user account that configured the cron job. In that situation, the default is often to write the mail in question to /var/mail/username, in mbox format. |
| | | |
− | When a cron job produces output, cron's default behavior is to send an email to the user account under which the job ran. However, in most situations, an email address has not been set up for that user, so the email is instead written to a mailbox file. Most Unix shells will notify the user with a message like "You have new mail" when this mailbox file is updated, but if the user doesn't know how to check this mail file, they will likely just ignore the message.
| + | Most shells will check that file, and produce a message "You have new mail" when its timestamps have changed. |
| | | |
− | In this case, Cueball has been ignoring his mailbox for fifteen years. When he finally learns where to look, he discovers more than a gigabyte worth of messages from the cron program, the vast majority of which are likely meaningless. Ponytail says to Cueball "fix your cron" (likely meaning he should fix the task that's generating the output so that it doesn't do so), then set a parameter that tells cron to send email to an address he actually checks. (He could also opt to direct the mails to <code>/dev/null</code>, which would discard them, or simply disable the mail in the crontab.) Cueball, however, interprets the tremendous amount of email as spam and decides to redirect the emails to <code>/etc/crontab</code>, the main configuration file that contains all of cron's scheduling information. He apparently believes that this will either stop the emails or cause cron to spam itself instead.
| + | [[Cueball]] is not aware of all of the above, and expresses surprise at the repeated messages. [[Ponytail]] tells him to check /var/mail/cueball, When he realizes what has happened, he configures the mail system so that it writes all mail for his user to the cron configuration, thereby probably breaking it and ensuring that the shell will stop producing "You have new mail" messages. |
| | | |
− | In reality, this will not cause significant problems as the <code>MAILTO</code> environmental variable in cron takes an email address or usernames on the local system and attempts to send emails to them. It will not write or append output to a local file like <code>/etc/crontab</code>. Thus when cron attempts to email <code>/etc/crontab</code> the mail program cron uses will generate an error saying it can't find the user <code>/etc/crontab</code>.
| + | ==Transcript== |
− | | + | Cueball is sitting at a table on his laptop. Ponytail walks up to him. |
− | For example, if you create the following crontab:
| |
− | | |
− | <pre>
| |
− | MAILTO=/etc/crontab
| |
− | | |
− | * * * * * echo "Some output from a cronjob"
| |
− | </pre>
| |
− | | |
− | installed on a user named <code>me</code> on a system called <code>mycomputer</code> then you will see a new error messages email to you (located in <code>/var/mail/me</code>) stating it can't send email to a user named <code>/etc/crontab</code> and the undelivered email is being returned to the sender. The error email will look like the following:
| |
− | | |
− | <pre>
| |
− | From MAILER-DAEMON Tue Sep 6 14:47:01 2016
| |
− | Return-Path: <>
| |
− | | |
− | | |
− | Received: by mycomputer.local (Postfix)
| |
− | id 5341C64EE516; Tue, 6 Sep 2016 14:47:01 -0400 (EDT)
| |
− | Date: Tue, 6 Sep 2016 14:47:01 -0400 (EDT)
| |
− | | |
− | Subject: Undelivered Mail Returned to Sender
| |
− | | |
− | Auto-Submitted: auto-replied
| |
− | MIME-Version: 1.0
| |
− | Content-Type: multipart/report; report-type=delivery-status;
| |
− | boundary="33AF864EE514.1473187621/mycomputer.local"
| |
− | | |
− | | |
− | This is a MIME-encapsulated message.
| |
− | | |
− | --33AF864EE514.1473187621/mycomputer.local
| |
− | Content-Description: Notification
| |
− | Content-Type: text/plain; charset=us-ascii
| |
− | | |
− | This is the mail system at host mycomputer.local.
| |
− | | |
− | I'm sorry to have to inform you that your message could not
| |
− | be delivered to one or more recipients. It's attached below.
| |
− | | |
− | For further assistance, please send mail to postmaster.
| |
− | | |
− | If you do so, please include this problem report. You can
| |
− | delete your own text from the attached returned message.
| |
− | | |
− | The mail system
| |
− | | |
− | | |
− | "/etc/crontab"
| |
| | | |
− | --33AF864EE514.1473187621/mycomputer.local
| + | '''Cueball''': I've been getting these "You have new mail" UNIX notifications for like 15 years, but I've never bothered to figure out what it's talking about. |
− | Content-Description: Delivery report
| |
− | Content-Type: message/delivery-status
| |
| | | |
− | Reporting-MTA: dns; mycomputer.local
| + | '''Ponytail''': Look in /var/mail? |
− | X-Postfix-Queue-ID: 33AF864EE514
| |
− | | |
− | Arrival-Date: Tue, 6 Sep 2016 14:47:00 -0400 (EDT)
| |
| | | |
− | Final-Recipient: rfc822; /etc/crontab@mycomputer.local
| + | '''Cueball''': Ok... |
− | Original-Recipient: rfc822; /etc/crontab
| |
− | Action: failed
| |
− | Status: 5.1.1
| |
− | Diagnostic-Code: X-Postfix; unknown user: "/etc/crontab"
| |
| | | |
− | --33AF864EE514.1473187621/mycomputer.local
| + | '''Cueball''': Oh, wow, there's like a gigabyte of stuff from Cron in here. |
− | Content-Description: Undelivered Message
| |
− | Content-Type: message/rfc822
| |
| | | |
− | | + | '''Ponytail''': *sigh* |
− | Received: by mycomputer.local (Postfix, from userid 501)
| |
− | id 33AF864EE514; Tue, 6 Sep 2016 14:47:00 -0400 (EDT)
| |
− | | |
− | | |
− | Subject: Cron <me@mycomputer> echo "Some output from a cronjob"
| |
− | X-Cron-Env: <MAILTO=/etc/crontab>
| |
− | X-Cron-Env: <SHELL=/bin/sh>
| |
− | X-Cron-Env: <PATH=/usr/bin:/bin>
| |
− | X-Cron-Env: <LOGNAME=me>
| |
− | X-Cron-Env: <USER=me>
| |
− | X-Cron-Env: <HOME=/Users/me>
| |
− | | |
− | Date: Tue, 6 Sep 2016 14:47:00 -0400 (EDT)
| |
| | | |
− | Some output from a cronjob
| + | '''Ponytail''': You should fix your Cron, then point "MAILTO=" somewhere you actually see- |
| | | |
− | --33AF864EE514.1473187621/mycomputer.local--
| + | '''Cueball''': Better idea: |
− | </pre>
| |
| | | |
| + | '''Cueball''' (typing into computer): export MAILTO=/etc/crontab |
| | | |
− | The title text shows that Cueball is somewhat aware of what cron does, including the fact that it's existed pretty much unchanged for several decades, but he hasn't bothered to really get into understanding it, treating it more as a foe to vanquish rather than as a tool to understand and use.
| + | '''Cueball''': There. Your move, Cron. |
| | | |
− | ==Transcript==
| + | '''Ponytail''': Wow. Hardball. |
− | :[Cueball is sitting at a table in an office chair working on his laptop. Ponytail walks up to him.]
| |
− | :Cueball: I've been getting these "You have new mail" UNIX notifications for like 15 years, but I've never bothered to figure out what it's talking about.
| |
| | | |
− | :[Ponytail has stopped behind Cueball who is typing on his laptop. When Ponytail (and later Cueball) mentions code, the text uses both small and capital letters (as opposed to only capital letters in all other text).]
| + | '''Cueball''': Let's see how important it thinks that mail really is. |
− | :Ponytail: Look in /var/mail? | |
− | :Cueball: OK...
| |
− | :Cueball: Oh, wow, there's like a gigabyte of stuff from Cron in here.
| |
| | | |
− | :[In a frame-less panel Ponytail is facepalming. Cueball is replying from off-panel with a starburst indicating his position.]
| + | {{incomplete transcript}} |
− | :Ponytail: *Sigh*
| |
− | :Ponytail: You should fix your Cron, then point "MAILTO=" somewhere you actually see-
| |
− | :Cueball (off-panel): Better idea:
| |
| | | |
− | :[Same setting as panel 2 but Cueball is visibly typing on the laptop as shown with three small curved lines over his hands on the keyboard.]
| |
− | :Cueball: export MAILTO=/etc/crontab
| |
− | :Cueball: There. Your move, Cron.
| |
− | :Ponytail: Wow. Hardball.
| |
− | :Cueball: Let's see how important it thinks that mail really is.
| |
| | | |
| {{comic discussion}} | | {{comic discussion}} |
− |
| |
− | [[Category:Comics featuring Ponytail]]
| |
− | [[Category:Comics featuring Cueball]]
| |
− | [[Category:Computers]]
| |