![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script creating too many processes. | Miller_K | Shell Programming and Scripting | 3 | 05-22-2007 12:42 PM |
| Restart Script | chapmana | UNIX for Dummies Questions & Answers | 1 | 11-27-2006 11:21 AM |
| need help to write script to check the process health and automatically restart it | dragondad | Shell Programming and Scripting | 1 | 10-31-2006 06:16 PM |
| suspend/restart a process in shell script | daneensign | Shell Programming and Scripting | 1 | 02-14-2006 12:43 AM |
| How to restart a script from the top | indo1144 | Shell Programming and Scripting | 2 | 07-02-2002 08:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
need help: shell script to restart apache when no. of processes keeps growing
I need a shell script to kill apache and restart it, in case the number of processes keeps growing. The logic is like the below, but I don't know how to get the number and neither the syntax. Could somebody kindly help?
if no_of_processes (ps ax ¦ grep httpd) > 200 then killall httpd apachectl start I'm using Fedora Core3 |
|
||||
|
Quote:
killall ????????????????????????? That's the first thing that comes to your mind? Ever considered trying to stop something in a decent way instead of using kill as first option? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|