On Fri, Dec 29, at 12:50 [EMAIL PROTECTED] wrote:
> On 26/12/06 17:28:18, Ag. Hatzimanikas wrote:
> > On Tue, Dec 26, at 11:26 [EMAIL PROTECTED] wrote:
> > > 
> > > I'm  failing  at  figuring   out how to set $PATH for fcron jobs. I want 
> > > to be
> > > able to start scripts that depend on a modified $PATH.  If  I'm  not  
> > > mistaken
> > > fcron  runs  as  the  special  user  fcron  and then changes to the user 
> > > it is
> > > executing a job for. In the login  manpage  it  says  login  would  set  
> > > $PATH
> > > according to the fields:
> > > "The  value for $HOME, $SHELL, $PATH, $LOGNAME, and $MAIL are set 
> > > according to
> > > the appropriate fields in the password entry"
> > > Just what fields are these? Or should I set the $PATH somehow else?
> > 
> > Fcron belongs to blfs,so "blfs-support" mailing list is more appropriate 
> > than this
> > one.
> > 
> > To answer your question,please try to set up the desired path to the 
> > fcrontab itself.
> > 
> > PATH=/bin:/usr/bin:/home/lynx/scripts
> 
> Ah,  thanks. I thought I'd have to get login set the PATH. Still I'm wondering
> where the default PATH is coming from before any  bash_profile  or  bashrc  is
> read. Some where I read it would be compiled in, just didn't say where.

Here some observations.

a.
Build fcron as root with the usual procedure.
Now as normal user,unset any PATH variable in the crontab you may have and try 
to
send the output of the $PATH with a cronjob to some file.

* * * * * echo "$PATH" >/tmp/path

In my case the output is the PATH of the root.

[421](~d/temp)c /tmp/path 
/sbin:/bin:/usr/sbin:/usr/bin:/home/opt/bin

Stop now the fcron process and start a new build as normal user.
Don't have to run 'make install',just start the new fcron binary (you
have to do as root) and do the same thing with above.
In my tests the output of the path it's my users $PATH.

b.
The PATH var is not a valid variable in /etc/fcron.conf

c.
If you try in the crontab,to append your script's dir to an existing PATH
variable,like so,

PATH=$PATH:/home/user/bin

It will recognize only the last part of the variable (/home/user/bin).

d.
Setting the PATH variable in the crontab will reset any existing PATH.

e.
Add a var in the crontab,just say,
TEXT="here are some text"
and then do,

* * * * * echo  "$TEXT" > /tmp/text

and last but I believe the most important part of the subject,
f.
Any PATH var (or any other var like the $TEXT above) is inherited to your 
scripts.

PS.
Or just set the absolute path to the script,like the most people would
recommend (for total control) and try to set up _in_ there,any variable you 
want.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to