Connecting Tech Pros Worldwide Forums | Help | Site Map

Some help with a php script..

benson_james@yahoo.com
Guest
 
Posts: n/a
#1: Aug 11 '06
Hi folks,

Im trying to write a simple php script. Basically all i want it to do
is detect if a process is running or not then just set a variable to
Running or Stopped.

Its running on linux, ive already written one for for some processes
that leave pid files but this daemon doesnt leave a pid file.

Can anyone help please. Thanks


Tim Hunt
Guest
 
Posts: n/a
#2: Aug 11 '06

re: Some help with a php script..



benson_james@yahoo.com wrote:
Quote:
Hi folks,
>
Im trying to write a simple php script. Basically all i want it to do
is detect if a process is running or not then just set a variable to
Running or Stopped.
>
Its running on linux, ive already written one for for some processes
that leave pid files but this daemon doesnt leave a pid file.
>
Can anyone help please. Thanks
exec('pidof processname') will return the id of a running process, if
there's more then one of the process it returns a list of ids separated
by spaces.

Regards
Tim

Closed Thread