Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2002 22:11:35 -0800
From:      "Paul A. Scott" <pscott@skycoast.us>
To:        Len Conrad <LConrad@go2france.com>, <freebsd-questions@freebsd.org>
Subject:   Re: .sh interactive ok, from crontab, not
Message-ID:  <BA06FF17.14B81%pscott@skycoast.us>
In-Reply-To: <5.1.1.6.2.20021125005050.01e0c638@mail.go2france.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Oh, besides (or instead of) using the -w flag, you might also consider just
shorting the width of the output lines. Since you don't need all the
information between the user and command fields, you could just use:

if ( ps -ax -o user,command | grep -iq "^root.*master" ) ; then

Another possibility arises when a daemon writes its own process id into
/var/run/ when it starts up, and removes it on termination. So, you could
possibly test for the existence of the .pid file, such as:

if [ -f /var/run/master.pid ] ; then

Hope this helps.

Paul

-- 
Paul A. Scott
mailto:pscott@skycoast.us
http://skycoast.us/pscott/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA06FF17.14B81%pscott>