• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

kill sessions/processes

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
indypung
Asked:
indypung
1 Solution
 
brettmjohnsonCommented:
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
 
tfewsterCommented:
Under HP-UX, it would be:
su - <user> -c kill -1
0
 
avizitCommented:
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

Industry Leaders: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now