Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

kill -9 pid doesnt kill! 2

Status
Not open for further replies.

developerinlondon

Programmer
Jan 11, 2003
196
GB
I am trying to kill some processes but they dont seem to die.
Basically the process I am trying to kill is 'df'. After typing df it just hangs. It appears the problem could be to do with a samba i installed earlier. I only mounted a samba share pointing to another machine. That machine was rebooted and it seems it left it in this state as a result...
I cant even do shutdown -R, it kills a few of the running processes but then doesnt do anything. I am presuming shutdown uses the same method for killing the processes.

Top shows a load of over 7 where usually it doesnt go much far from 0.2. The load jumps up each time I try to run df.

I am using gentoo r11 2.6.7 on x86_64 AMD Opteron Processor 248.

Thanks for any help in advance!

nayeem
 
Have you tried an init 0 to shutdown. In my experience it's a little more brutal than shutdown in the way it goes about killing processes.
 
sorry but how do i do an init 0? (bear in mind i dont have physical access to the system and its a production server so i need all the services running when it comes back)
 
Hi Nayeem. Sorry, didn't appreciate that you don't have physical access to the server. init 0 won't do in that case, but init 6 should bring the box back up after shutting it down. Maybe take a look at the man page for init for your particular brand first to get a flavour of what's happening.
 
the manpage seems to be the standard init manpage. just tried init 6 also but it still seems to be not bothered... none of the services went down. is there any way I can check if its doing anything or not?
What could be stopping the df process from dieing? I think the bottleneck is there.
 
is /sbin/reboot -f worth a try? according to manpage that should be equivalent to a hard reboot. i dont want to run a risk of messing up the system however as its a production server.
 
It seems (from the man page for halt/reboot), that the -f flag runs reboot without calling shutdown as it normally would. So on the face of it, this might work where shutdown and init have failed. One further word of caution - do you have any databases (Oracle or whatever) that need to be shut down gracefully before the reboot? If so, do that first.
 
why don't you try to restart samba and then kill -9 df_pid_number



``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
samba and nfs are both turned off. the df process is waiting on an uninterruptible sleep...
i will try the restart -f
 
i meant reboot -f

but it seems to have worked! reboot -f seems to be a softer way of doing a hard reboot.
 
If kill -9 doesn't work, you can try 'killall <processname>'

-Haben sie fosforos?
-No tiengo caballero, but I have un briquet.
 
The reason you cannot kill the process is because it's permenantly blocked, waiting for I/O and therefore the process never returns back to the foreground to receive the signal.
Using "killall" will make no difference since it simply sends a -9 to the process, the same as "kill -9 pid".


Trojan.
 
I've had killall succeed where kill -9 failed though; but you're right at least in this instance (And maybe more, I've been wrong before!), it wouldn't work. I had missed the bit about 'df' ..

-Haben sie fosforos?
-No tiengo caballero, but I have un briquet.
 
but it seems to have worked! reboot -f seems to be a softer way of doing a hard reboot.

In the future, execute the sync command immediately before forcing the system to die in a non-graceful manner. This will flush filesystem buffers to disk, and ensure that you can cleanly mount the filesystems after reboot.

If you think not having physical access sucks now, just wait until you can't mount / because it's marked dirty and the automated fsck fails. "sync;sync;sync;reboot -f" is your friend.


 
thanks jkupski for that! that takes care of the worry I was having of cold reboots!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top