- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Kill the dead processes
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 01:30 AM
06-15-2004 01:30 AM
I have a question about how to kill the dead processes on my server.
My company uses an ERP software called Glovia and it only has 50 runtime user licenses.
When more than 50 users are logged in, it gives users trouble. I used 'ps -ef |grep glovia|more'
and found out that there are a lot dead processes still sitting there for more than or days. I killed all of those dead processes. Then the users can log in without problem.
I am wondering how I can write a shell script to do it. I want to kill the processs those belong to Glovia user are older than 1 day, since ps -ef only show the time not the date, could someone tell me how to write the script?
Really appreciate your help!
Leah
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 01:35 AM
06-15-2004 01:35 AM
Re: Kill the dead processes
You can write a script and put it into cron, but I again stress that the vendor needs to FIX their application.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 01:39 AM
06-15-2004 01:39 AM
Re: Kill the dead processes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 04:34 AM
06-15-2004 04:34 AM
Solutionps -ef | grep glovia | cut -c1-33 | awk 'NF>5'
This will also send the kill command assuming that useme exists (from a previous run) as executable:
ps -ef | grep kmo| cut -c1-33 | awk 'NF>5 {print "kill $2"}'> us
"kill $2"}'> useme; ./useme
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 04:40 AM
06-15-2004 04:40 AM
Re: Kill the dead processes
#!/bin/ksh
_Month=`date +%b`
ps -ef |grep -v "root">/tmp/process.lst
for _Line in `cat /tmp/process.lst`; do
if [[ (echo $_Line|grep "$_Month") -ne "" ]]; then
echo $_Line|tr -s " "|cut -d" " -f3|xargs -i kill -9 {}`
fi
done
This will capture the PS output for all non-root proceses, look for the abbreviated month in the PS listing, extract the PID from that line, and pipe it to kill -9.
You can change the 'grep -v "root"' part to 'grep "userid"' where "userid" is the ID that runs the processes in question. What you want to avoid is automatically killing all your root owned processes and crashing your system.
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 06:45 AM
06-15-2004 06:45 AM
Re: Kill the dead processes
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 10:52 PM
06-15-2004 10:52 PM
Re: Kill the dead processes
I adopted a 'C' program solution to
dealing with this sort of problem.
E.g. in your case I would have a daily
Cron job run my program as follows:
sig -r 96
This would send the TERM KILL sequence
to all (backgrounded) instances of the named process over 4 days old..
If you want to try this approach instead of writing
a shell or Perl script , I could supply source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2004 01:10 AM
06-16-2004 01:10 AM
Re: Kill the dead processes
Leah