public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederik Deweerdt <deweerdt@free.fr>
To: Diego Alencar Alves de Lima <diegolima.br@gmail.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Script to check a process
Date: Sat, 8 Jul 2006 12:36:41 +0200	[thread overview]
Message-ID: <20060708103641.GA1933@slug> (raw)
In-Reply-To: <200607080109.48851.diegolima.br@gmail.com>

On Sat, Jul 08, 2006 at 01:09:48AM -0300, Diego Alencar Alves de Lima wrote:
> How can I make a script that will check to see if a certain process is 
> running? The process name is "nspluginviewer" and there should be 3 of it 
> running (each one called from a konqueror process).  Then it would reboot the 
> computer if it didn't detect the three running.
> 
There are many ways to do it, one could be:

while [ $(pidof <command> | awk '{print NF;}') -eq <nr occurences> ]; do sleep 1; done ; shutdown -r now

Regards,
Frederik
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

      reply	other threads:[~2006-07-08 10:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07  9:46 Commenting out out_of_memory() function in __alloc_pages() Abu M. Muttalib
2006-07-07  9:54 ` Robin Holt
2006-07-11 14:57   ` Abu M. Muttalib
2006-07-11 15:08     ` Abu M. Muttalib
2006-07-11 15:19       ` Abu M. Muttalib
2006-07-13  5:12         ` Mouhammad Tayseer Alquoatli
2006-07-11 15:35       ` Chase Venters
2006-07-24  9:44         ` Abu M. Muttalib
2006-07-07 21:21 ` Chase Venters
2006-07-08  4:09   ` Script to check a process Diego Alencar Alves de Lima
2006-07-08 10:36     ` Frederik Deweerdt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060708103641.GA1933@slug \
    --to=deweerdt@free.fr \
    --cc=diegolima.br@gmail.com \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox