From: kriner@cena.fr (Bruno KRINER)
Subject: Re: killing a process by name?
Date: 1999/06/10 [thread overview]
Message-ID: <7jorsf$d7$1@geant.tls.cena.fr> (raw)
In-Reply-To: 928943775.8997.0.nnrp-08.c2deb51d@news.demon.co.uk
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
One manner to do this could be :
kill `/sbin/init.d/bin/getpid process-name-with-path-such as-it-appears-in-ps \
-u process-owner`
It works !
Regards
>
>Christopher Kolar wrote in message
><375d6a41.14695581@news.aurora.edu>...
>>Hello everyone. This is probably a basic question, but I have
>not
>>found the solution yet so I thought I would float it. I have a
>host
>>running OSF 4.0d. After everyone leaves for the day I am going
>to
>>have cron start a program "foo". Foo should run until midnight,
>when
>>it needs to be killed so that out nightly backups can happen.
>>
>>Problem is that: a) foo has no -kill or similar tag; b) foo does
>not
>>drop the process number into a pid file that can be piped into a
>kill
>>command.
>>
>>So my question, is ther a simple way to set up a shell script
>that
>>cron can call at midnight that will grep "foo" out of the ps
>command,
>>and then kill -PID for foo? I am not much of a shell script
>>programmer, and only play a system administrator on TV, so those
>are
>>two strikes against me. Any help or pointers to the right
>resources
>>would be much appreciated.
>>
>
>Others will tell you about ps and grep, but an alternative is to
>use a shell script to start the job and record it's PID in a
>file. This pid can be used to kill your job.
>
>Hope this helps
>Adam
>
>
>
---
B. Kriner
Centre d'Etudes de la Navigation A�rienne (CENA)
7,Av. Edouard Belin BP4005 31055 Toulouse Cedex
Tel: (33) (0)5 62 25 95 40
Fax: (33) (0)5 62 25 95 99
E-mail: kriner@cena.fr
http: //www.tls.cena.fr/~kriner
next prev parent reply other threads:[~1999-06-10 4:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-08 4:00 killing a process by name? Christopher Kolar
1999-06-08 4:00 ` Serguei Patchkovskii
1999-06-09 4:00 ` Adam Price
1999-06-10 4:00 ` Bruno KRINER [this message]
1999-06-09 4:00 ` Mark Lambert
1999-06-09 4:00 ` Paul David Fardy
1999-06-09 4:00 ` Jeff Denham
1999-06-16 4:00 ` Tim Mooney
1999-06-16 4:00 ` Jeff Denham
1999-06-09 4:00 ` Javier de Burgos
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox