On Sunday 02 October 2005 22:22, Tim Nelson wrote:
> On Wed, 28 Sep 2005, Jason Kim wrote:
> > I've noticed that cfexecd stays in the directory it was started in even
> > when in daemon mode. May or may not have caused a problem I was
> > experiencing with one of my shellcommands (the directory I started it in
> > was subsequently deleted). I did a bunch of stuff at the same time, so I
> > couldn't isolate/verify the fix, but chdir'ing to '/' is probably a good
> > thing anyway. Simple patch follows.
>
>       Wouldn't we be better off with
> --------------
> struct passwd RootPassStruct;
>
> RootPassStruct =  getpwnam("root");
> chdir(RootPassStruct->pw_dir);
> --------------
>
Sorry, the list bounced me, wasn't answering from the right address. 2nd try, 
original reply below.

I suppose that works too... I thought that it was common practice to cd to
'/' for any daemon simply because it is always guaranteed to be there.  
As the problem I had (though I'm still not 100% sure) had to do with
cfexecd having a deleted directory as its cwd, I figured this would be the
best fix.
-JayKim


_______________________________________________
Bug-cfengine mailing list
Bug-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cfengine

Reply via email to