Solved

Process list with PHP

Posted on 2006-11-22
4
414 Views
Last Modified: 2008-03-06
Hello there,

I have a php script calling a perl script with exec("/home/*/script.pl &");
Since this php script is frequently accessed, and the pl script executes slow processes, I need to know if the script.pl is running, so I can choose between run it again or not. Is there any way that a php script could have access to linux process list, or, even better, just check wheter a pl script is running or not?

Thanks
0
Comment
Question by:mafosil
4 Comments
 
LVL 3

Accepted Solution

by:
nishayr earned 125 total points
ID: 17995486
Hey there,

Maybe have the script create a '.scriptlockfile' or something when it starts, and remove that file when completing.

When the script starts, it can check for the existence of this file, and exit if the file exists and create the file and continue processing if the file is not there...

Thanks,
Nish
0
 

Author Comment

by:mafosil
ID: 18007567
I have it as my backup solution, but what I really want is a solution that I dont need to do this kind of 'trick' thou that's what I'll do if nothing comes up.

Thanks :)

Marcelo Silveira
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
notReplace  challenge 53 131
string initialization in java 11 113
Re-position sub-options beneath the TAB 7 90
Problem to page 4 86
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question