05-09-2008
[REQ] Automatic script kill process
HI,
I'm using CentOS 5.1 x86_64, CPanel ..
a lot of my users used too much resource, i want to write a script to kill all of them.
Eg: LFD always notify me:
Time: Sun Apr 27 07:40:08 2008
Account: xxxx (my user)
Resource: Virtual Memory Size
Exceeded: 110 > 100 (MB)
Executable: /usr/bin/php
Command Line: php /home/xxxx/public_html/import.php
PID: 20897
Killed: No
or .
Time: Sat Apr 26 18:40:50 2008
Account: xxxx (my user)
Resource: Process Time
Exceeded: 7305 > 1800 (seconds)
Executable: /usr/bin/php
Command Line: /usr/bin/php /home/xxxx/public_html/index.php
PID: 27308
Killed: No
Now, can you help me ??
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello guys,
I have a process named monitoreo, with 'monitoreo start' my process start until i kill them, now i want to do 'monitoreo stop' to kill them.
After 'monitoreo start' i have this process running:
ps -af
UID PID PPID C STIME TTY TIME CMD
ati 10958 1495 ... (5 Replies)
Discussion started by: Lestat
5 Replies
2. UNIX for Dummies Questions & Answers
Hello
We are using UNIX, (?) there were reports to us thAt their login was automatically killed, however we (root) did not issue a kill -9 PID, can anyone give me an idea what happen. To add, the user is not idled, he is actually doing something.
also, i search all the thread, donno if i... (5 Replies)
Discussion started by: lancemendioro
5 Replies
3. Shell Programming and Scripting
HI All
Im new to shell scripting...kindly plz help me...
I need a shell script for:
We have to take export of all db's on daily basis from all svr's and keep these export backups on diffrent server.
Plz help.
Regards
Gaurav (5 Replies)
Discussion started by: ergauravtaneja
5 Replies
4. Shell Programming and Scripting
hello Bros,
I need to write some script that i can put it on crontab which checks for a process X if running. If the process X is ruuning then take the PID and kill it or display message that says process X is not running.
I am using AIX 5.3
Thanks guys.:b: (2 Replies)
Discussion started by: malcomex999
2 Replies
5. Shell Programming and Scripting
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies
6. Shell Programming and Scripting
Hello all... new to these forums and a bit of a newbie with linux aswell.
I need to figure out how to write a shell script to kill a process by name as given to the script as an argument. I've got that part working OK, but i need to make sure that the script does not allow processes that are... (6 Replies)
Discussion started by: cannon1707
6 Replies
7. UNIX for Dummies Questions & Answers
What I need to learn is how to use a script that launches background processes, and then kills those processes as needed.
The script successfully launches the script. But how do I check to see if the job exists before I kill it?
I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies
8. Shell Programming and Scripting
Hi
I have the process to kill regulary, but the PSID is dymatic change and not sure how to kill the specific process ID
Check the tradekast_rvd is running , if such process, kill the els process id
ps -e f |grep tradekast_rvd
ps -ef |grep els
then I kill els process id
... (2 Replies)
Discussion started by: linux_user
2 Replies
9. HP-UX
Hi All,
One of our servers stopped responding , unable to take any logins into it, the response is almost nil...later it resumed
Also during this time one of our application processes which was costly on memory got killed..is it an OOM kill?
Would like to know to know how to avoid such... (4 Replies)
Discussion started by: baanprog
4 Replies
10. Shell Programming and Scripting
Hi,
I just random create 1000 folder which range from 0-20,000 . Inside all the folder, I have copy over the same program named as run.sh to run in each folder.
Can I know that how to write a master script to let it automatic run the "run.sh" in each different random folder create?
Some... (5 Replies)
Discussion started by: perl_beginner
5 Replies
LEARN ABOUT PHP
apache_lookup_uri
APACHE_LOOKUP_URI(3) 1 APACHE_LOOKUP_URI(3)
apache_lookup_uri - Perform a partial request for the specified URI and return all info about it
SYNOPSIS
object apache_lookup_uri (string $filename)
DESCRIPTION
This performs a partial request for a URI. It goes just far enough to obtain all the important information about the given resource.
This function is supported when PHP is installed as an Apache module or by the NSAPI server module in Netscape/iPlanet/SunONE webservers.
PARAMETERS
o $filename
- The filename (URI) that's being requested.
RETURN VALUES
An object of related URI information. The properties of this object are:
ostatus
othe_request
ostatus_line
omethod
ocontent_type
ohandler
ouri
ofilename
opath_info
oargs
oboundary
ono_cache
ono_local_copy
oallowed
osend_bodyct
obytes_sent
obyterange
oclength
ounparsed_uri
omtime
orequest_time
EXAMPLES
Example #1
apache_lookup_uri(3) example
<?php
$info = apache_lookup_uri('index.php?var=value');
print_r($info);
if (file_exists($info->filename)) {
echo 'file exists!';
}
?>
The above example will output something similar to:
stdClass Object
(
[status] => 200
[the_request] => GET /dir/file.php HTTP/1.1
[method] => GET
[mtime] => 0
[clength] => 0
[chunked] => 0
[content_type] => application/x-httpd-php
[no_cache] => 0
[no_local_copy] => 1
[unparsed_uri] => /dir/index.php?var=value
[uri] => /dir/index.php
[filename] => /home/htdocs/dir/index.php
[args] => var=value
[allowed] => 0
[sent_bodyct] => 0
[bytes_sent] => 0
[request_time] => 1074282764
)
file exists!
PHP Documentation Group APACHE_LOOKUP_URI(3)