Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How do I check to see if a process is running
If I want to know if a process is currently running such as

user1  1729     1  0 14:58:13 ?        0:00 start

What command do I use to look for it?  I know I could do a Unix ps and =
grep for the process name and then awk it down but it seems that there =
has got to be a way in Perl to do this.  I been through the Camel and =
Ram books and I can find all sorts of stuff about creating processes but =
I guess I am just missing the part about testing to see if a process is =
running.

Rob Witzke
The Public Library of Cincinnati
rob.witzke@cincinnatilibrary.org


Report this thread to moderator Post Follow-up to this message
Old Post
Rob Witzke
09-27-04 08:57 PM


Re: How do I check to see if a process is running
> If I want to know if a process is currently running such as
>
>   user1  1729     1  0 14:58:13 ?        0:00 start
>
> What command do I use to look for it?  I know I could do a Unix ps and
grep for the process name and then awk it down but it seems that there
has got to be a way in Perl to do this.  I been through the Camel and
Ram books and I can find all sorts of stuff about creating processes but
I guess I am just missing the part about testing to see if a process is
running.
>
> Rob Witzke
> The Public Library of Cincinnati
> rob.witzke@cincinnatilibrary.org
>

Generally you can't, mostly because systems vary a lot when it comes to
such things as process wrangling, etc. More specifically your best
options are to check the process table, either using Proc::ProcessTable
or with the method you describe, or by having the running process store
a 'pid' file, which is the normal *nix way. Long running services will
generally store the process ID to a file on the system, then other
processes that need to check it or send it signals will read that pid
for the information, if you have control over the subprocess you want to
check you should have it do this.

HTH,

http://danconia.org


Report this thread to moderator Post Follow-up to this message
Old Post
Wiggins d Anconia
09-28-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.