Cron

From UGCS
Revision as of 21:19, 25 March 2009 by Ckennelly@ugcs.caltech.edu (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Getting cron services available to users is a work in progress. Presently, cron is being architected with two sides:

  • Users update their crontabs using a modified crontab program in their path which notifies a central server on updates. The central server (currently hephaestus for testing) parses their file and stores well-formatted commands into our database (currently MySQL).
  • The central cron server runs its own (real) cron command every minute to check the database for commands to run. It then uses a keytab to load username_cron principals (currently only ckennelly_cron exists), logs into a shellserver, and runs the command.

Parsing

The modified crontab program lives at ~ckennelly/cron/crontab. It stores the user's crontab at ~/.cron/crontab. When the directory is created, crontab gives the _cron principal read permission on the directory's ACL.

It fires a notification to hephaestus via remctl to parse the crontab. It loads up its keytab using a bash-based wrapper (/usr/local/lib/remctl/cron/cronparser_wrapper) and then fires the python-based parser (/usr/local/lib/remctl/cron/cronparser).

The parser has some features, but is still lacking in others:

  • More testing!
  • Comma-separated lists (ranges work, along with non-default increments)
  • Comma-separated lists with ranges
  • Shortcuts (like @hourly)
  • Three-letter names for months and days of week
  • Standard environment variables (like the real crontab specification), SHELL and MAILTO. Additionally, I haven't checked support for HOME at runtime.
  • Support UGCS-specific environment variables in the crontab. Alex suggested having RUNAT so a user could specify a specific shellserver to run the command at.

Execution

Still in development. Lives on hephaestus at /usr/local/lib/cron/cronmanager

Installation

Hephaestus required:

  • sqlobject for python
  • mysqldb for python (python-mysqldb)
Personal tools