[rrd-users] Re: One other quickie :-D

Clifton Royston cliftonr at lava.net
Tue Jun 26 20:51:18 MEST 2001


On Tue, Jun 26, 2001 at 10:29:44AM -0600, Shipley, Rob wrote:
> 
> Have you "su bin" and executed the scripts as bin?(Most cron jobs are not
> executed as user root, they run under bin). 

If we're talking about jobs started from /etc/crontab, as I think we
are, then not in most UNIX versions I have played with - though I
wouldn't be surprised if it's true for some.

I did play with an earlier version of Mandrake a year or two ago, and I
don't recall the global crontab executing cron jobs as bin.  I think
its default is to run them as root, like most Unices.

...

> Thanks to those of you that replied to my question. It really helped, heck
> it fixed my problem :-)
> My other problem that I wasn't able to get my perl scripts that update the
> RRD to run thru cron. I tried 2-3 different approaches.
> 
> 1) Tried using the 'use RRDs' method, and invoke the updates as Perl
> functions
> 2) Make a system call to update the RRD `rrdtool update ...`
> 3) use pipe to update the RRD "./perl_script | rrdtool -
> 
> All of these methods work independently, meaning that if I run them thru the
> command line, I have no problems. It is just when I run them thru cron that
> nothing happens. I'm running as root, in Mandrake 7.2 from the / directory.
> I asked around and people told me to try and give absolute path names, which
> I did, and still nothing happened.

Some versions of cron lose much of the login environment for scripts
they run; PATH is only one of the things they mess up.  Initial
directory, and environment variables including SHELL, HOME, and LOGNAME
as well as PATH may be messed up.

Try running some debug code thru cron to print out as much info as you
can to help you in this, e.g. a shell script

#!/bin/sh
id
pwd
env
which perl_script
which rrdtool
which perl

Maybe something there (or not there) will help you figure out what's
going on.
  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr at lava.net
   WWJD?   "JWRTFM!" - Scott Dorsey (kludge)   "JWG" - Eddie Aikau

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list