LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Starting killall... hangs on reboot! (http://www.linuxquestions.org/questions/linux-general-1/starting-killall-hangs-on-reboot-723267/)

saghi 05-03-2009 01:37 AM

Starting killall... hangs on reboot!
 
while doing soft rebooting of server using "init 6" or "reboot" or "shutdown -r now" failed to reboot the server.
The system hangs at - "Starting killall". Require hard reboot for the servers
Any help in resolving this issue will be great

Disillusionist 05-03-2009 04:14 AM

What does it do when trying a shutdown?
Code:

shutdown -h now
If it hangs doing this, then how about changing through the init levels until you find which one is causing the issue:

Code:

init 4
init 3
init 2
init 1
init 0

EDIT:

When going to Run Level 0 the last two scripts to be called are:
S00killall
S01halt

The message "Starting killall" would be called at this point to shutdown any services that are still running. The fact that your machine is hanging at this point suggests that there are services that are still running that the script is unable to kill.

It may be worth adding a bit of logging to this script.

saghi 05-03-2009 05:51 AM

Quote:

Originally Posted by Disillusionist (Post 3528310)
What does it do when trying a shutdown?
Code:

shutdown -h now
If it hangs doing this, then how about changing through the init levels until you find which one is causing the issue:

Code:

init 4
init 3
init 2
init 1
init 0

EDIT:

When going to Run Level 0 the last two scripts to be called are:
S00killall
S01halt

The message "Starting killall" would be called at this point to shutdown any services that are still running. The fact that your machine is hanging at this point suggests that there are services that are still running that the script is unable to kill.

It may be worth adding a bit of logging to this script.

yes Also i have this problem in shutdown -h now but in init1,2 is OK, Be informed that we have automatic startup script for start and stop application server and asdb automatically. I want the command that can find the related services that killall try to stop

saghi 05-03-2009 06:13 AM

yes Also i have this problem in shutdown -h now but in init1,2 is OK, Be informed that we have automatic startup script for start and stop application server and asdb automatically. I want the command that can find the related services that killall try to stop

Disillusionist 05-03-2009 12:36 PM

The killall script (/etc/init.d/killall) is run when entering run level 0

I have edited the version on my system (modifications in red):
Code:

#! /bin/bash

# Bring down all unneeded services that are still running (there shouldn't
# be any, so this is just a sanity check)
echo "Starting /etc/init.d/killall" > /killall.log

case "$1" in
  *start)
      ;;

  *)
      echo $"Usage: $0 {start}"
      exit 1
      ;;
esac

for i in /var/lock/subsys/* ; do
      echo "Found $i" >> /killall.log

      # Check if the script is there.
      [ -f "$i" ] || continue

      # Get the subsystem name.
      subsys=${i#/var/lock/subsys/}

      # Networking could be needed for NFS root.
      [ $subsys = network ] && continue

      # Bring the subsystem down.
      if [ -f /etc/init.d/$subsys.init ]; then
            /etc/init.d/$subsys.init stop
      elif [ -f /etc/init.d/$subsys ]; then
            /etc/init.d/$subsys stop
      else
            rm -f "$i"
      fi
done

echo "Finished /etc/init.d/killall script" >> /killall.log

This should create a log of what services the killall script is trying to kill, and hopefully provide a starting point for your investigation.


All times are GMT -5. The time now is 11:43 PM.