LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-13-2003, 10:52 AM   #1
lockejr
Member
 
Registered: Jan 2003
Location: Wichita, KS
Distribution: Slack, Gentoo, CPUBuilders
Posts: 37

Rep: Reputation: 15
killing a hung up process with a script


Ok here is my situation, In our shipping warehouse I have a print server running CUPS. Every once in awhile ghostscript get hung up and it puts a halt to everything until we can kill gs and restart cupsd. My boss wants me to make a script that will check everyfew minutes to see if gs is hung up or not and if so kill it and restart cupsd. now I know how to kill it without using a pid through my script from searching the forums but how can i get it to check how long, let's say i want it to kill it if it has been running for more than 3 minutes. any ideas?
 
Old 05-13-2003, 01:07 PM   #2
lockejr
Member
 
Registered: Jan 2003
Location: Wichita, KS
Distribution: Slack, Gentoo, CPUBuilders
Posts: 37

Original Poster
Rep: Reputation: 15
nevermind i figured it out
 
Old 04-13-2006, 11:40 PM   #3
ender42
LQ Newbie
 
Registered: Jan 2006
Posts: 28

Rep: Reputation: 15
care to share your solution?

I'd love to see it...

I assume it started out as something similiar to this:

ps aux|grep user|grep pattern|awk '{print $2}'|xargs kill -9

Last edited by ender42; 04-13-2006 at 11:47 PM. Reason: one way of killing stuff without pid's
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating the "killing" process via a shell script fatrandy13 Linux - Software 5 09-13-2007 11:59 PM
Process killing script owix Linux - General 2 07-19-2005 11:08 AM
Problems killing process Artik Debian 6 05-03-2005 10:29 AM
Killing a process by its name rabeea Linux - Networking 3 03-17-2005 05:30 AM
Really Killing a Process! lazlow69 Linux - Newbie 14 05-10-2003 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration