*BSD News Article 59102


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!dhawk
From: dhawk@netcom.com (David H)
Subject: Re: Continued Crontab Problem on 2.0.5
Message-ID: <dhawkDKx8CF.Ap3@netcom.com>
Organization: Decline to State
References: <dhawkDKM3qJ.IHp@netcom.com> <4cmf93$eli@uriah.heep.sax.de>
Date: Tue, 9 Jan 1996 15:57:50 GMT
Lines: 36
Sender: dhawk@netcom13.netcom.com

In article <4cmf93$eli@uriah.heep.sax.de>,
J Wunsch <joerg_wunsch@uriah.heep.sax.de> wrote:
>dhawk@netcom.com (David H) writes:
!> But I do have a /var/cron/tabs/stats
!> for user 'stats' with a home directory of '/yapp/info/stats'
!> and the /var/cron/tabs/stats has
!> USER=stats
!> HOME=/yapp/info/stats      (this is the home directory from passwd)
!> LOGNAME=stats

!> and it runs a program that writes a configuration file in its
!> home directory. The problem is that it keeps trying to write
!> to /root instead of /yapp/info/stats even with USER, HOME, and LOGNAME
!> set. Why would the stats crontab job think /root is its home
!> directory? (The stats crontab file was installed with 
!> 	crontab -u stats [filename] 
!> by root.)

>You should not use relative path names.  Try ${HOME}/foobar.

>(I assume cron runs in the home directory of root, instead of cd'ing
>into $HOME before.)

To restate the problem: the 'stats' crontab runs a compiled binary
that does a system call to determine its home directory. It gets
an answer of '/root' instead of the actual 'stats' home directory.

Shouldn't a program run by the user 'stats' be able to find the
home directory for stats?


later, david
--
David Hawkins    dhawk@netcom.com
When you can't do as you would, you must do as you can.  
                       -- Anna Warner