CentOS 4.7: shutdown does not complete

General support questions including new installations

CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/05 13:28:30

CentOS 4.7 on Acer4000 laptop

I recently had need to completely reinstall CentOS. (Reason for reinstall: laptop had been allowed to run to battery exhaustion and had powered-off with an unorderly shutdown; on re-boot (with power) the system would not reboot into CentOS. It is a dual-boot system and re-boot into Windows was successful).

I installed 4.2 from CD and immediately used yum to bring it up to 4.7. Straightforward installation, no problems encountered.
Re-installation of / and /usr partitions was done after re-formatting the partitions. The remaining partitions (/home, /opt, /tmp, /var and /usr/local) were not re-formatted.

After re-installation the systems boots to CentOS and runs with no apparent problems.

But on shutdown (or re-boot) the shutdown sequence terminates early - immediately after the message shown below is displayed:

INIT: no more processes left in this runlevel

If I try ctl-alt-del I get a further single line displayed:

INIT: switch to runlevel 6

But the shutdown sequence does not go any further (e.g. file-systems are not umount’ed) and certainly does not complete.

I have to force a hard power-off.
On re-boot I therefore get “not properly shutdown” messages and am requested to fsck the filesystems. Note that when I do fsck all the filesystems none report any problem and boot successfully completes and I can logon and use the system. (or I can boot without the fsck and the boot successfully completes and I can logon and use the system).

But the interruption to boot, and the need to fsck each time on boot, is a PITA.

I have checked out possible causes of the “INIT: no more processes left in this runlevel” message; most seem to discuss possible disk errors, but the fsck command is returning no problems found.

What might be the possible problems that would result in this error message and failure to complete shutdown?
Where should I look to investigate?
Any suggested remedies that would clear the problem (and allow shutdown to complete to power-off)?

TIA
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Re: CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/06 13:29:49

Possibly related. I have found that on boot I get the following messages early in the boot sequence:

Code: Select all
Apply: Intel microcode update: don't know how to make device "cpu/microcode"
/etc/rc5.d/S00microcode_ctl: microcode device /dev/cpu/microcode doesn't exist?

I've not had these before (the re-installation). Perhaps they are related to my shutdown problem reported at the start of the thread.
The second line is certainly correct: there is indeed no such file (nor indeed is there a /dev/cpu). There is a file /etc/rc5.d/S00microcode_ctl.

I assume that somewhere in the boot sequence is a mknod /dev/cpu/microcode type statement; it would appear that it is not being successfully executed.

Any information/remedies gratefully received.

Later addtion: this link http://www.centos.org/modules/newbb/vie ... mpost17510 may at least solve my /dev/cpu/microcode issue.
But the shutdown query still stands.
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Re: CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/06 19:09:02

pdown85 wrote:
...
Later addition: this link http://www.centos.org/modules/newbb/vie ... mpost17510 may at least solve my /dev/cpu/microcode issue.
But the shutdown query still stands.

The above link (increasing count from 5 to 10 made no difference. The /dev/cpu/microcode therefore issue remains.

Consequently no closer to solving the original problem either.
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Re: CentOS 4.7: shutdown does not complete

Postby AlanBartlett » 2009/01/06 20:07:29

I have just had a look at the /etc/rc.d/init.d/microcode_ctl file on a CentOS 4 system.

The block of code in question is:

Code: Select all
# perform the update
function start ()
{
        RETVAL=1
        # Make sure we are on an intel machine
        vendor=`cat /proc/cpuinfo | \
            grep "^vendor_id" | sort -u | \
            awk -F ": " '{ print $2 }'`
        if [ "$vendor" != "GenuineIntel" ]; then
            return
        fi

        # 2.6.9-42.31 or later required to support our latest microcode
        # Check for older kernel to see if we need to use older microcode
        kv=`uname -r`
        major=`echo $kv | cut -d"-" -f2 | cut -d"." -f1`
        minor=`echo $kv | cut -d"-" -f2 | cut -d"." -f2`
        if [ $(echo $minor | grep -c EL) -ge 1 ]; then
            # We actually have no minor, we got the dist tag, so set minor to 0
            minor=0
        fi
        if [ "$major" -lt "42" ] || [ "$major" -eq "42" -a "$minor" -lt "31" ]
        then
            FIRMWARE=/etc/firmware/microcode_old.dat
            ARGUMENTS="$ARGUMENTS -f $FIRMWARE"
        fi

        echo -n $"Applying Intel Microcode update: "

        if [ ! -e $FIRMWARE ];
        then
                echo $"$0: microcode datafile not present ($FIRMWARE)"
                exit 1
        fi

        /sbin/modprobe microcode
        /sbin/MAKEDEV cpu/microcode
        lt=0
        while [ ! -c $DEVICE ]; do
                lt=$[lt+1];
                [ $lt -gt 5 ] && break;
                sleep 1;
        done

        # Lets just be sure we have a device file...
        if [ ! -e $DEVICE ];
        then
                echo $"$0: microcode device $DEVICE doesn't exist?"
                exit 1
        elif [ ! -c $DEVICE ];
        then
                echo $"$0: $DEVICE not a character device?"
                exit 1
        fi

        daemon $PROGRAM $ARGUMENTS
        RETVAL=$?
        /sbin/rmmod microcode
        rm -f $DEVICE

        # trap the most common case, errno 19 = no device
        if [ $RETVAL -eq 19 ];
        then
                echo $"$0: kernel does not have microcode device support"
        fi
        echo
}

Will you please confirm the above is what you have?

To understand what is going on you could try something like the following:

sh -x /etc/rc.d/init.d/microcode_ctl start 2>&1 | tee /var/tmp/log.txt

Unfortunately, the C-4 system I have access to has an AMD processor and so the microcode_ctl script will only execute as far as the test for the processor type. My C-5 system does have an Intel processor but the microcode_ctl script is different.
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/12 21:04:07

Thanks for the reply.
The block of code in question in the /etc/rc.d/init.d/microcode_ctl file on my CentOS 4 system (I have reverted to 4.2) is as shown:
Code: Select all
function start ()
{
        RETVAL=1
        # Make sure we are on an intel machine
        vendor=`cat /proc/cpuinfo | \
            grep "^vendor_id" | sort -u | \
            awk -F ": " '{ print $2 }'`
        if [ "$vendor" != "GenuineIntel" ]; then
            return
        fi

        echo -n $"Applying Intel Microcode update: "

        if [ ! -e /etc/firmware/microcode.dat ];
        then
                echo $"$0: microcode datafile not present (/etc/firmware/microcode.dat)"
                exit 1
        fi

        /sbin/modprobe microcode
        lt=0
        while [ ! -c $DEVICE ]; do
                lt=$[lt+1];
                [ $lt -gt 10 ] && break;
                sleep 1;
        done

        # Lets just be sure we have a device file...
        if [ ! -e $DEVICE ];
        then
                echo $"$0: microcode device $DEVICE doesn't exist?"
                exit 1
        elif [ ! -c $DEVICE ];
        then
                echo $"$0: $DEVICE not a character device?"
                exit 1
        fi

        daemon $PROGRAM $ARGUMENTS
        RETVAL=$?
        /sbin/rmmod microcode

        # trap the most common case, errno 19 = no device
        if [ $RETVAL -eq 19 ];
        then
                echo $"$0: kernel does not have microcode device support"
        fi
        echo
}

The differences to the variant you've shown are clear.
The command sh -x /etc/rc.d/init.d/microcode_ctl start 2>&1 | tee /tmp/microcode-log.txt gives:
Code: Select all
[root@localhost tmp]# more microcode-log.txt
+ DEVICE=/dev/cpu/microcode
+ ARGUMENTS=-Qu
+ RETVAL=0
+ PROGRAM=/sbin/microcode_ctl
+ . /etc/init.d/functions
++ TEXTDOMAIN=initscripts
++ umask 022
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
++ export PATH
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -z '' ']'
+++ /sbin/consoletype
++ CONSOLETYPE=pty
++ '[' -f /etc/sysconfig/i18n -a -z '' ']'
++ . /etc/sysconfig/i18n
+++ LANG=en_GB.UTF-8
+++ SUPPORTED=en_GB.UTF-8:en_GB:en
+++ SYSFONT=latarcyrheb-sun16
++ '[' pty '!=' pty ']'
++ '[' -n '' ']'
++ export LANG
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ GRAPHICAL=yes
+++ RES_COL=60
+++ MOVE_TO_COL='echo -en \033[60G'
+++ SETCOLOR_SUCCESS='echo -en \033[0;32m'
+++ SETCOLOR_FAILURE='echo -en \033[0;31m'
+++ SETCOLOR_WARNING='echo -en \033[0;33m'
+++ SETCOLOR_NORMAL='echo -en \033[0;39m'
+++ LOGLEVEL=3
+++ PROMPT=yes
++ '[' pty = serial ']'
++ '[' color '!=' verbose ']'
++ INITLOG_ARGS=-q
+ case "$1" in
+ start
+ RETVAL=1
++ cat /proc/cpuinfo
++ grep '^vendor_id'
++ sort -u
++ awk -F ': ' '{ print $2 }'
+ vendor=GenuineIntel
+ '[' GenuineIntel '!=' GenuineIntel ']'
+ echo -n 'Applying Intel Microcode update: '
Applying Intel Microcode update: + '[' '!' -e /etc/firmware/microcode.dat ']'
+ /sbin/modprobe microcode
+ lt=0
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=1
+ '[' 1 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=2
+ '[' 2 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=3
+ '[' 3 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=4
+ '[' 4 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=5
+ '[' 5 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=6
+ '[' 6 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=7
+ '[' 7 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=8
+ '[' 8 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=9
+ '[' 9 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=10
+ '[' 10 -gt 10 ']'
+ sleep 1
+ '[' '!' -c /dev/cpu/microcode ']'
+ lt=11
+ '[' 11 -gt 10 ']'
+ break
+ '[' '!' -e /dev/cpu/microcode ']'
+ echo '/etc/rc.d/init.d/microcode_ctl: microcode device /dev/cpu/microcode doesn'\''t exist?'
/etc/rc.d/init.d/microcode_ctl: microcode device /dev/cpu/microcode doesn't exist?
+ exit 1
[root@localhost tmp]#

I have found that trying to manually execute /sbin/MAKEDEV cpu/microcode results in:
Code: Select all
[root@localhost tmp]# /sbin/MAKEDEV cpu/microcode
don't know how to make device "cpu/microcode"
[root@localhost tmp]#

the reason for which is a mystery to me.
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Re: CentOS 4.7: shutdown does not complete

Postby AlanBartlett » 2009/01/13 12:39:24

Very puzzling.

I wonder if it is an idea to check the microcode module, modinfo microcode, load it, modprobe microcode, confirm it is loaded, lsmod | grep micro, and look in your /dev directory. Do you have a /dev/cpu directory? If yes does it have any contents?

I've had a look at the /dev/cpu directory of a CentOS 4, update 7 system:

Code: Select all
[ajb@nova9 ~]$ ls -lR /dev/cpu
/dev/cpu:
total 0
drwxr-xr-x  2 root root 80 Jan  1 08:36 0
lrwxrwxrwx  1 root root  5 Jan  1 08:36 msr0 -> 0/msr

/dev/cpu/0:
total 0
crw-------  1 root root 203, 0 Jan  1 08:36 cpuid
crw-------  1 root root 202, 0 Jan  1 08:36 msr
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/13 14:17:17

Thanks for the reply.

Actually no, I don't have a /dev/cpu directory.

And looking on a second CentOS box (Dell desktop/server) I have:
this does not have a /dev/cpu directory either and the lsmod | grep micro command returnds nothing - and this second box is exhibiting no problems whatsoever on either startup or shutdown. Although the modinfo microcode does return information on this server. Second CentOS system details:
Code: Select all
[root ~]# more /proc/version
Linux version 2.6.9-78.0.1.EL (mockbuild@builder16.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 Tue Aug 5 10:49:42 EDT 2008
[root ~] #


I am not currrently able to run the commands you suggest on the CentOS (acer) laptop (that will have to wait until this evening), but given what I am seeing on a working desktop box I am not sure I am very hopeful of this telling me much!
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Re: CentOS 4.7: shutdown does not complete

Postby AlanBartlett » 2009/01/13 16:34:40

I really don't know what is happening with your laptop or your server / desktop. :-? I'm assuming that the latter does have an Intel processor and we are seeing the difference between C-4.2 and C-4.7.

I wonder if I can get toracat's attention? -- especially as it is our friendly feline's C-4.7 system that I have been accessing to make my investigations!
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: CentOS 4.7: shutdown does not complete

Postby toracat » 2009/01/13 17:31:30

I have read through the thread but I don't have anything I can offer at this moment. Is my understanding correct that the shutdown problem manifested itself when the OS was updated from 4.2 to 4.7? In other words, 4.2 did not have this problem?
User avatar
toracat
Forum Moderator
 
Posts: 6694
Joined: 2006/09/03 16:37:24
Location: California, US

Re: CentOS 4.7: shutdown does not complete

Postby pdown85 » 2009/01/13 18:04:36

Intel only location! :-)
Yes the shutdown problem manefested itself after the laptop shutdown in an uncontrolled manner (battery expired) and, because the (then 4.7) system would not reboot, I re-installed 4.2 (from CD) and yum'ed up to 4.7. But I was now encountering the shutdown problem described in the first message in the thread. And now I was also seeing the microcode error message on system startup (which had not occured before the failure and re-installation sequence).
pdown85
 
Posts: 45
Joined: 2005/04/16 23:54:41
Location: UK

Next

Return to CentOS 4 - General Support

Who is online

Users browsing this forum: No registered users and 1 guest