[packagekit] running without a head via cron
Matthew Miller
mattdm at mattdm.org
Wed Mar 5 12:22:48 PST 2008
On Tue, Mar 04, 2008 at 03:21:42PM +0000, Richard Hughes wrote:
> Patch attached allows PackageKit to be optionally run once a day using
> cron. Is this sane? I think it's quite useful on the headless server use
> case and it's trivial to add.
So, this is basically what Sveta is working on here at BU. We've currently
got a big ol' shell script which runs yum periodically, and we're looking to
move away from that.
There's some significant advantages in having your controlling program (i.e.
that which gets run from cron) be something other than a shell script.
1) Error handling. If something goes wrong, we want a different message than
for success -- different subject, different body, etc. Plus, there's many
different types of errors (network problems, repo problems, local package
db problems, etc.) which need different responses.
2) Dealing with network transiency. This is a big enough issue that I want
to highlight it separately from error handling in general. Network errors
may be temporary, in which case we don't want to send out too many
annoying messages, but we may want to log a warning if they go on for too
long.
3) Formatting output. Generally, utilities designed for command-line use
don't have output that's idea for e-mail. And, we probably want to also
have the option of sending HTML mail. But for obvious curmudgeonly
sysadmin reasons this must be optional.
4) Avoiding writing temporary files for mail output. Temporary files just
add a whole 'nuther category of potential failures. (What if updates are
broken because /var is full?)
5) Creeping feature doom. It'd be nice to be able to set which repos get
updated automatically, which get only security updates, which get only
notification. Handling that in a shell script gets crazier and crazier.
There's probably more. That's off the top of my head. :)
So, I think it's ideal to not call a designed-for-the-CLI frontend from a
shell script, but rather replace the shell script with a
designed-for-background program.
--
Matthew Miller mattdm at mattdm.org <http://mattdm.org/>
Boston University Linux ------> <http://linux.bu.edu/>
More information about the PackageKit
mailing list