RE: Creating PID file



My apologies. I know this is a cross-platform group, and that is fine. However, if you are unable to understand simple Linux terminology, then it is doubtful that you can help answer my question. If the description is nonsense to you, then please don't waste your or my time in an apparent slam on my choice of operating systems. If your reply represents the general attitude of this list, then it looks like I've come to the wrong place for assistance.

But, to simplify my request, a pid is a process id. In Linux, the command 'ps' will give a listing of process IDs.
I need the script to determine its own pid, then write that to a file.

Thanks,
Michael


-----Original Message-----
From: Rob Dixon [mailto:rob.dixon@xxxxxxx]
Sent: Sat 4/26/2008 6:49 PM
To: beginners@xxxxxxxx
Cc: Michael Barnes
Subject: Re: Creating PID file

Michael Barnes wrote:

This may be a bit advanced for a beginner's group, but I need to have my
script create a pidfile. I'm running a monitor app that keeps track of
what is running and notifies me when stuff stops. It does it by
comparing the pid in the pidfile with ps. So, I need my script to
create a pidfile when it starts.

Ideas appreciated.

This is far more than a beginners' group, but your post is heavy with Unix terminology. Remember that this is a cross-platform group.

I know that a PID is a process ID, and I can imagine what a 'pidfile' might be, but 'comparing the pid in the pidfile with ps' is nonsense.

Explain the problem, and we will help to solve it.

Rob


.



Relevant Pages

  • Re: LTT user input
    ... and to that end have taken the existing trace infrastructure ... script for that event (if there's a handler defined for the event ... This gives the script a chance to do whatever Perlish thing it ... syscall totals to individual syscall totals for each pid. ...
    (Linux-Kernel)
  • Re: Fwd: Any way to find the network usage by a process?
    ... Here's a variation of Jose's script that uses the networking tapset and prints top-like output for transmits and receives. ... Much of the activity shows up under pid 0, ... Can anyone suggest better probe points to get transmits and receives by pid? ... execname[pid()] = execname ...
    (Linux-Kernel)
  • Re: Two processes with PID == 0
    ... In my case, the process (script ... see that your second process with pid 0 is ... Protect your identity with Yahoo! ... To unsubscribe, ...
    (freebsd-current)
  • DESTROY executed twice
    ... I wrote a script that forks several child ... In MyModules/MyClass.pm there is a DESTROY method for taking some ... houskeeping actions (closing database handle and deleting PID file): ... When running the script, everything works fine except for each ...
    (perl.beginners)
  • Re: Creating PID file
    ... the command 'ps' will give a listing of process IDs. ... I need the script to determine its own pid, then write that to a file. ... pidfile is created in /var/run by saying something like ...
    (perl.beginners)