Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 140869 - sys-process/cronbase run-crons logging patch
Summary: sys-process/cronbase run-crons logging patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Cron Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 169449
  Show dependency tree
 
Reported: 2006-07-17 22:46 UTC by J'raxis 270145
Modified: 2009-04-14 06:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Logging patch for run-crons (run-crons.patch,525 bytes, patch)
2006-07-17 22:47 UTC, J'raxis 270145
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J'raxis 270145 2006-07-17 22:46:23 UTC
A patch to add logging to /usr/sbin/run-crons.

run-crons itself doesn't do any logging, which can make debugging crons rather difficult, as all one can usually see in the cron log is /usr/sbin/run-crons being run every ten minutes.

The logging format is meant to look like vixie-cron's.
Comment 1 J'raxis 270145 2006-07-17 22:47:14 UTC
Created attachment 92053 [details, diff]
Logging patch for run-crons
Comment 2 SpanKY gentoo-dev 2006-07-18 14:07:48 UTC
run-crons is used by all cron daemons, so any changes have to work with all versions of cron

also, instead of forking `whoami`, why not just use $USER
Comment 3 J'raxis 270145 2006-07-18 18:44:50 UTC
It'll work with any crons; it's just calling the standard logger(1) program, and using a facility/prio of cron.info so it goes to the right place. The only relation to vixie cron is that I modeled the log message format after it.

As for $USER, I was staying away from env vars because they're not particularly reliable for accounting purposes. Although in the case of a root/system crontab I can't see how it could be compromised, so it'll do.
Comment 4 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2008-10-08 10:11:59 UTC
checking for the existence of logger would also be a little more safe (dont know if the bsds have logger)

and all scripts are run by root anyway, so no need for whoami... or not?

this looks good though, i'll likely put it in...
Comment 5 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-04-14 06:15:44 UTC
included in cronbase-0.3.3. thanks...