Hello,
How can I use 'sh' as an interactive shell?
My configuration files are the defaults.
The file '.profile' has the following:
[...]
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
[...]
The file '.shrc' has the following:
[...]
#
On Mon, Nov 25, 2002 at 07:47:46AM +0100, Len Conrad wrote:
Try running 'ps' using the -w flag (wide column mode):
if ( ps -auxw | grep -iq ^root.*master ) ; then
I've tested this and it works.
here, too, thanks!!
One -w switches from 80 column width to 132 column width, but two -w's
Trying to write a little watch-dog/keep-alive script for a couple of
related daemons, an MTA and an SMTP AV scanner.
This snippet works fine...
if ( ps aux | grep -i ^root.*master ) /dev/null
then
echo then: exit code equal 0
exit 0
else
try to run the daemon
... when run from the command
From: Len Conrad [EMAIL PROTECTED]
snip
This snippet works fine...
if ( ps aux | grep -i ^root.*master ) /dev/null
then
echo then: exit code equal 0
exit 0
else
try to run the daemon
... when run from the command line, the echo text displays. But, when run
from crontab every 10
if ( ps aux | grep -i ^root.*master ) /dev/null
then
echo then: exit code equal 0
exit 0
else
try to run the daemon
... when run from the command line, the echo text displays. But, when run
from crontab every 10 minutes, the if fails, and the else clause runs.
I've tried every syntax
From: Len Conrad [EMAIL PROTECTED]
It works for me, and I suspect that it's working for you, too.
well, it's really not. The crontab execution is trying to run the daemon
even when the daemon shows up in ps aux.
Well, it was just a guess. :) I tested against my 'named' daemon, using the
Well, it was just a guess. :) I tested against my 'named' daemon, using the
code you supplied and it works fine.
same code works fine for my AV daemon, but not for the MTA daemon
What version of FreeBSD?
4.5
Are you using
the 'stock' shell?
yes
Did you look at the output from grep
I forgot to mention, I'm blue in the face
Sorry, didn't know what you'd already done. Thought I had to ask.
... but your version, or my multiple versions, have never mishaved from the
command line, it's running from crontab that does comes out inverted.
What does your crontab entry look
What does your crontab entry look like?
*/10* * * * root/usr/local/bin/watchdog.sh
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message
Okay, I was able to duplicate your problem. It is due to the output of 'ps'
being truncated to 80 columns, the default terminal size. You are likely
running a wide terminal display on your interactive session (as I do) but
cron will see the default 80 column terminal. This is the difference
Okay, I was able to duplicate your problem. It is due to the output of 'ps'
being truncated to 80 columns, the default terminal size. You are likely
running a wide terminal display on your interactive session (as I do)
yep, TeraTerm on Windows, very wide display.
but cron will see the
11 matches
Mail list logo