Use the user under which the cron job will be set-up under.  It will use
the same envirnment

david

On Wed, 25 Sep 2002, Barton Hodges wrote:

> I'm not sure this is the right place to ask this
> question, but I'll give it a shot.
> 
> I have a perl script that runs as a daemon, listening
> on port 10022.
> 
> If I call the script from the command line, logged in
> as root,  it works great.  However, if the script is
> called from CRON, or by any startup scripts (such as
> after a reboot), the script does not accept connections
> and effectively fails.
> 
> I found that if I change the crontab entry and call
> the script through "su", then it works:
> 
> su - root -c "script"
> 
> It also works this way in the startup scripts.
> 
> Now I understand that the "-" parameter to "su" makes the
> shell a login shell and changes many environment settings.
> 
> My question is this:
> 
> How can I test the script from an environment exactly like
> that which CRON or the login scripts run in?
> 
> That way, I can figure out exactly what is going wrong and
> what environment settings need to be changed.
> 
> Thanks.
> 
> Barton
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to