- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: System process
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
07-29-2005 11:38 AM
07-29-2005 11:38 AM
System process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2005 04:26 PM
07-30-2005 04:26 PM
Re: System process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 12:36 AM
07-31-2005 12:36 AM
Re: System process
I am new to write script , could provide me some help ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 02:53 AM
07-31-2005 02:53 AM
Re: System process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 03:10 AM
07-31-2005 03:10 AM
Re: System process
all these are dead processes , the system run it normally but can kill the process automatically , could suggest a script ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 12:51 PM
07-31-2005 12:51 PM
Re: System process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 05:00 PM
07-31-2005 05:00 PM
Re: System process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2005 06:01 PM
07-31-2005 06:01 PM
Re: System process
ps -u
or
kill -9 `ps -u dbauser | | awk '{ split($3,a,":"); if ( a[2] > 10 ) { print $1; }}'`
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2005 06:59 PM
08-01-2005 06:59 PM
Re: System process
when run your script , it pop
sage: kill [ -s signal | -p ] [ -a ] pid ...
kill -l [ signal ]
it seems my system can't use "split" , could provide some help again ? thx in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2005 07:27 PM
08-01-2005 07:27 PM
Re: System process
But as someone else already replied you should better check what's causing this.
Anyway you can parse the PID (to send a signal to), and the elapsed time of the process).
In my example I send a "sleep 600" in the background, and I intend to shoot it if it was running for more than 3 mins.
1. parse pid and etime and store in vars
UNIX95= ps -o pid= -o etime= -C sleep|read pid etime
2. test if etime > 3 min. and shoot
[[ $(printf "%d" $(echo $etime|cut -d: -f1)) -ge 3 ]] && kill $pid
Ideally you would put the test (i.e. the [[ ]]) in a loop conditional block.
e.g.
until [[ $(printf "%d" $(echo $etime|cut -d: -f1)) -ge 3 ]];do sleep 10;done; kill $pid
There are hundred similar ways to implement this little functionality (probably better ones).
However, some caveat.
If the process you want to kill already has been running for several hours the etime format changes to HH:MM:SS
So your parsing would have to accomodate for such subtle nuissances.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2005 07:32 PM
08-01-2005 07:32 PM
Re: System process
I was too quick clicking forgetting thinking.
You of course need to put the variable assignment of $etime within the loop's body to update the value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 12:35 AM
08-02-2005 12:35 AM
Re: System process
I am not too understand the statement "UNIX95= ps -o pid= -o etime= -C sleep|read pid etime" , it seems no output to the system , could suggest simipler way ? thx in advance.