Solved

kill sessions/processes

Posted on 2004-08-26
3
334 Views
Last Modified: 2013-12-26
hi.  i have a nightly job that runs and spawns several unix processes.  each process has the same user as the owner.  during development, sometimes i get many sessions hung at one time.  then i have to go through and kill them all one by one by saying kill <pid>.  is there a way that i can issue a kill command that will kill all sessions owned by the userid that i'm currently logged in as?  this is hp-ux. thanks.

bp
0
Comment
Question by:indypung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 50 total points
ID: 11908421
A PID of -1 means kill all processes owned by the current user:

  kill -KILL -1

To kill all processes owned by another user requires super-user capabilities
(to su to that user):

  echo kill -KILL -1 | su -m <user>

0
 
LVL 21

Expert Comment

by:tfewster
ID: 11908481
Under HP-UX, it would be:
su - <user> -c kill -1
0
 
LVL 11

Expert Comment

by:avizit
ID: 11909388
does HP-UX  have  the 'pidof' command ?

if so you can also use

kill `pidof progname`  

as in if you want to kill the  opera browser  

kill `pidof opera`

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question