Cron
(Start of technical documentation.) |
|||
| Line 25: | Line 25: | ||
* sqlobject for python | * sqlobject for python | ||
* mysqldb for python (python-mysqldb) | * mysqldb for python (python-mysqldb) | ||
| + | |||
| + | [[Category:Sysadmin_Documentation]] | ||
Revision as of 00:18, 6 May 2009
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)