...and invoking this wrapper from cron instead of trying to reset the shell and everything from within cron. You can test things by doing an "su gs -c /bin/sh" from a root login and then trying to run your wrapper, which will give you a minimum environment closer to what cron executes under.


This was an interesting idea. I wrote a little ruby script to print out all set environment variable, then ran it under the simulated cron environment:

bin 520 $ su gs -c /bin/sh
$ ./env.rb
USER => gs
MAIL => /var/mail/gs
SHLVL => 2
HOME => /home/gs
_ => /bin/sh
BLOCKSIZE => K
TERM => xterm-color
SVN_EDITOR => vim
PATH => /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/ local/bin:/usr/X11R6/bin:/home/gs/bin
SHELL => /usr/local/bin/bash
PWD => /home/gs/bin
FTP_PASSIVE_MODE => YES
EDITOR => vim
$

Then under the environment I used to run the script by hand:

[EMAIL PROTECTED] ~/bin]$ ./env.rb
TERM => xterm-color
SHELL => /usr/local/bin/bash
OLDPWD => /home/gs
SSH_TTY => /dev/ttyp0
USER => gs
SVN_EDITOR => vim
FTP_PASSIVE_MODE => YES
MAIL => /var/mail/identry
PATH => /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/ local/bin:/usr/X11R6/bin:/home/identry/bin
BLOCKSIZE => K
PWD => /home/gs/bin
EDITOR => vim
HOME => /home/gs
SHLVL => 2
LOGNAME => identry
_ => ./env.rb

I don't see any difference that would explain this problem...

No mail is sent to either root or gs when the crontab runs.

Someone asked what version of PHP...

~ 504 $ php --version
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan  6 2008 18:26:54)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
~ 505 $

And if bash is really installed:

~ 505 $ bash --version
GNU bash, version 3.2.33(0)-release (amd64-portbld-freebsd6.3)
Copyright (C) 2007 Free Software Foundation, Inc.

I guess I will try using the shell script wrapper idea, to some more experiments in a more controlled environment.

-- John

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to