CRON w/o logging (reprise)
Jim Rosenberg
jr at oglvee.UUCP
Fri Aug 19 07:24:39 AEST 1988
>From article <755 at mccc.UUCP>, by pjh at mccc.UUCP (Pete Holsberg):
>
> I recently asked for help with a problem on a 3b2/400 running SysV R3.1.2.
> To wit, after a couple of days of norml operation, cron has stopped
> writing to /usr/lib/cron/log. Several people have suggested that the
> file may be too big, and that I should check the ulimit.
>
> The file is still less than 4096 bytes. ulimit is 20480. So I'm still
> in need of help.
>
> Incidentally, cron is still executing the crontab files -- it's just not
> logging its actions.
Hullo Pete!!
I remember your original posting, but it had slipped into a recess in the
mental attic. Then a funny thing: the same thing happened on my system.
cron was apparently working, but writing to the log file had stopped. This
happened on a day when I went on a cleanup rampage. We have lots of disk
space, but are close to the limit of one tape, so I've been savoring the
luxury of single-reel full backups. The other day we crossed the limit & I
decided to clean things up. Yes, yes, netlanders, I know, I should be cleaning
various log files weekly (weakly?) out of cron, but well, um, you know how
it is.
/usr/lib/log/cron was getting pretty big, so I gave the heave-ho to everything
but the last week's worth by sed'ing off only the last week's stuff into a
new file, then doing an mv of the new file to /usr/lib/log/cron. *SAME DAY*
is when cron stopped logging. I puzzled over this, and then realized that
maybe it was not so smart to do this while the inode was still open! Of
course an rm to an open file is quite legal in UNIX -- many programs use this
trick to make sure there are no temporary files hanging around. If you've
done something to the log file while cron is still running, cron may be using
an inode that doesn't appear in any directory entry, so it sure won't show
up when you look at /usr/lib/cron/log. How long since you rebooted? What
are the perms on /usr/lib/cron/log -- could you or someone else have done
something to it during the lifetime of the current cron process? Do you have
any scripts either executed out of cron or fired off by /etc/rc that clean
the log file while cron is running?
I gave cron the old SIGTERM (just kill <cron's_pid> with no signal number will
do nicely) and restarted cron from the shell. Logging commenced forthwith
and hasn't burped since.
Dunno if this is your problem, but try bringing down cron and restarting it.
--
Jim Rosenberg pitt
Oglevee Computer Systems >--!amanue!oglvee!jr
151 Oglevee Lane cgh
Connellsville, PA 15425 #include <disclaimer.h>
More information about the Comp.unix.wizards
mailing list