[Dirvish] Re: curious problem - dirvish does nothing when run from cron

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Fri Jan 12 13:26:04 UTC 2007


Michael Nelson wrote:
> I had this same problem.  When dirvish-runall ran from cron it took zero
> time to run and did nothing, but produced no errors.  If I ran it from
> root's shell it ran fine.
> 
> I had installed it in /usr/local/sbin, which seemed like a good place for
> something like dirvish, but /usr/local/sbin was not listed in the PATH in
> /etc/crontab.  /usr/local/sbin *is* in root's PATH as set up in root's
> .bashrc though.  
> 
> Unfortunately, at least in SUSE 10.2 the crontab PATH setting is absolute,

You can change the path in the crontab itself. man 5 crontab

> ie:
> 
>   PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
> 
> I think it would be better for it to be:
> 
>   PATH=$PATH:/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin

There are probably security issues with that. Not to mention that it
might make the output of cron jobs vary depending on arbitrary changes
in the external environment. Better for everything run by root to be
explicit.

> ... so it would pick up any path additions that had been done in the root
> account.
> 
> I wish that if dirvish-runall was unable to find dirvish it would spit out
> an error.  I could have fixed it days ago if it did.

It does produce an error: "dirvish: command not found". If you're not
seeing it, you need to check how you have cron configured to report errors.

Cheers, Dave




More information about the Dirvish mailing list