From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ccs.covici.com ([209.249.181.196]) by speech.braille.uwo.ca with esmtp (Exim 3.35 #1 (Debian)) id 1ABdpH-0002nc-00 for ; Mon, 20 Oct 2003 13:28:15 -0400 Received: from ccs.covici.com (IDENT:covici@localhost [127.0.0.1]) by ccs.covici.com (8.12.10/8.12.10) with ESMTP id h9KHSCSs015920; Mon, 20 Oct 2003 13:28:12 -0400 Received: (from covici@localhost) by ccs.covici.com (8.12.10/8.12.10/Submit) id h9KHSC4f015917; Mon, 20 Oct 2003 13:28:12 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16276.6955.927067.581027@ccs.covici.com> Date: Mon, 20 Oct 2003 13:28:11 -0400 From: John covici To: speakup@braille.uwo.ca Cc: ma-linux@tux.org Subject: Question about using pid In-Reply-To: <20031020171311.GE12274@rednote.net> References: <20031020171311.GE12274@rednote.net> X-Mailer: VM 7.17 under Emacs 21.3.50.2 Sender: speakup-admin@braille.uwo.ca Errors-To: speakup-admin@braille.uwo.ca X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: speakup@braille.uwo.ca X-Reply-To: covici@ccs.covici.com List-Help: List-Post: List-Subscribe: , List-Id: Speakup is a screen review system for Linux. List-Unsubscribe: , List-Archive: You might consider using pidof to get the process id of the program once it is running and I enclose what I use for the speakfreely monitor -- this might be of help. #!/bin/bash secs=15 while true do sleep $secs if [ `pidof sfspeaker | wc -w` != 2 ] then #if there are not two sfspeaker processes aplay -q /usr/src/speak_freely/busy.au fi done on Monday 10/20/2003 Janina Sajka(janina@rednote.net) wrote > I have a command that starts a process. Should that process die whilst > I'm not at my computer, I want a script to restart it. > > How do I do this? What doc might I read that would provide examples? > > I presume I should launch the process so that it's pid is written to a > file, and then I can just test for the running pid? > > But, I don't know how to go forward with this, so would appreciate all > advice and direction. > > > -- > > Janina Sajka > Email: janina@rednote.net > Phone: (202) 408-8175 > > Director, Technology Research and Development > American Foundation for the Blind (AFB) > http://www.afb.org > > Chair, Accessibility Work Group > Free Standards Group > http://accessibility.freestandards.org > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup -- John Covici covici@ccs.covici.com