Solved

Process list with PHP

Posted on 2006-11-22
4
419 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxMirror challenge 10 161
wordlen challenge 3 72
wordcount challenge 11 132
PHP question(s) about order of output 9 68
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

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