- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: kill 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
05-21-2002 05:08 PM
05-21-2002 05:08 PM
I want to kill all process which the owner is user1,how should I do?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:12 PM
05-21-2002 05:12 PM
Re: kill process
This should kill all processes related to user1. If the first one doesn't work the second should. You must be 'root' to perform this function properly.
# ps -ef | grep user1 | awk '{print $2}' | xargs kill -5
# ps -ef | grep user1 | awk '{print $2}' | xargs kill -9
Cheers
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:15 PM
05-21-2002 05:15 PM
Re: kill process
I use the following script which will prompt you for a username
echo "\nkill process script"
echo "====================="
listfile1=/tmp/rm_process.list
listfile2=/tmp/rm_process.list2
sleep 1
echo "Please enter you choice of process"
read choice
rm -f $listfile1 $listfile2 2>&1
ps -ef | grep $choice | cut -c10-15 > $listfile1
sed 's/^/kill -15/g' $listfile1 > $listfile2
chmod 777 $listfile2
$listfile2
echo "\nkill process script ends"
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:19 PM
05-21-2002 05:19 PM
Re: kill process
one more question:
I found the cron daemon is start by user1!
I try to kill -9 pid, but doesn't work! how should I do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:22 PM
05-21-2002 05:22 PM
Re: kill process
/sbin/init.d/cron stop
to restart
/sbin/init.d/cron start
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:24 PM
05-21-2002 05:24 PM
Re: kill process
I picked up this info from 'Bill Hassell'
regarding processes. Have a read it's very interesting
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:24 PM
05-21-2002 05:24 PM
Re: kill process
I did this already, but doesn't work. Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:25 PM
05-21-2002 05:25 PM
Re: kill process
Can you post the output of your
ps -ef | grep cron
Cheers
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:28 PM
05-21-2002 05:28 PM
Re: kill process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:36 PM
05-21-2002 05:36 PM
Re: kill process
It looks as though the process appears to be hung, when you look at it from top, is it sleeping ? If so the kill may be ignored
I've done a quick search and found the following doc
A reboot may sound a little drastic but may cure the problem
http://forums.itrc.hp.com/cm/components/FileAttachment/0,,0x4c04a22d6d27d5118fef0090279cd0f9,00.htm
Have a read through
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:44 PM
05-21-2002 05:44 PM
Re: kill process
That is a very interesting document, and the information is a good starting point. Rarely have I seen a 'hung' cron process. In saying that the 'cron' process should run as user 'root'. Is that the case on your system, using 'user1' as an example?
Is the 'cron' process still logging jobs to the cron log? (/var/adm/cron/log)
I agree, that the last resort will be a system reboot.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:45 PM
05-21-2002 05:45 PM
Re: kill process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:57 PM
05-21-2002 05:57 PM
Re: kill process
the cron's log is stopped already.
but the cron daemon is still running, maybe
hung already. kill -9 doesn't work, the value
of w is >100!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 05:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 06:07 PM
05-21-2002 06:07 PM
Re: kill process
Just had major issues attempting to reply
As per Micheal's comments, run the jobs manually. The doc states
NOTE: Only restarting the machine can free up the resources used by
a hung unsignalable process.
CAUTION: Anytime you have unkillable processes issuing a shutdown command
may cause the system to hang during shutdown. The reboot command
is a better alternative. Use reboot(1m) after stopping all
processes (See killall script) and umounting all filesystems that
can be umounted.
Note: using reboot, killall is in /sbin/init.d
Good luck
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 06:09 PM
05-21-2002 06:09 PM
Re: kill process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 06:25 PM
05-21-2002 06:25 PM
Re: kill process
Now would also be a perfect opportunity to look at planning for the future and to patch your system(s). Given that a hung process can also be an unexpected condition in the system kernel may indicate that there is a bug.
HTH
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2002 06:25 PM
05-22-2002 06:25 PM
Re: kill process
Just in case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2002 06:35 PM
05-22-2002 06:35 PM
Re: kill process
Very good point
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2002 07:19 AM
05-23-2002 07:19 AM
Re: kill process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 09:32 AM
05-24-2002 09:32 AM
Re: kill process
[[Assuming you are using the HP-UX cron and not an extention]]
If rebooting is a problem and you wish to not run the cron jobs by hand then move the cron related fifo:mv /var/adm/cron/FIFO /var/adm/cron/FIFO.old
create a new FIFOmknod /var/adm/cron/FIFO p
And run cron again as root: /usr/sbin/cron
This should start a clean cron that can continue to work.
Hopefully your /var is not an NFS :-).
A possible reason why your /usr/sbin/cron is not responding is because some parent process is stuck.
I hope this will resolve your problem.
Cheers,
Ahmed.