Bug 25744 - System hangs at shutdown
System hangs at shutdown
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
Florence RC-1
Depends On:
  Show dependency treegraph
Reported: 2001-02-02 13:30 EST by Sammy
Modified: 2014-03-16 22:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-07 16:15:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
lsof.log (4.33 KB, text/plain)
2001-02-06 16:01 EST, Sammy
no flags Details
Now lsof is in /bin and out is /bin/lsof.log (4.39 KB, text/plain)
2001-02-06 16:17 EST, Sammy
no flags Details

  None (edit)
Description Sammy 2001-02-02 13:30:27 EST
After the upgrade (and I was at Rawhide January 22 before) everytime
I shot down the halt script seems to hang at the umount level. Here is
the message I get:

Turning off swap:               [OK]
umount2: Device or resource busy
umount: /usr: device is busy
INIT: no more processes left in this runlevel

and hangs...if I do ctrl+alt+del at this stage.....I get

shutdown: warning: cannot open /var/run/shutdown.pid

I have tried this logged in as root from the console.
Comment 1 Bill Nottingham 2001-02-02 13:37:41 EST
Exactly which version of initscripts do you have installed?
Comment 2 Glen Foster 2001-02-02 17:57:42 EST
We (Red Hat) should really fix this before next release
Comment 3 Sammy 2001-02-05 18:03:12 EST
Sorry for getting back late:

I retried 5.59 and 5.60 and they both give the same error 5.55 works just
fine (once you fix the network script error).

After reboot I also noticed that it is always the /usr partition that it
is hanging on. All other partitions (/, /boot, /var, /home, /tmp) do umount
cleanly....strange. I checked /etc/mtab and all partitions/filesystems have
the same properties.

$ cat /proc/mounts
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
/dev/hda1 /boot ext2 rw 0 0
/dev/hda5 /home ext2 rw 0 0
/dev/hda8 /tmp ext2 rw 0 0
/dev/hda10 /usr ext2 rw 0 0
/dev/hda6 /var ext2 rw 0 0
none /dev/pts devpts rw 0 0
automount(pid416) /misc autofs rw 0 0                     

Could it be a problem with umount?
Comment 4 Bill Nottingham 2001-02-05 18:12:13 EST
Blarg. Can you install lsof, copy it to /bin,
and add a call to it inside the:

 while [ -n "$remaining" ...

loop in /etc/rc.d/init.d/halt?

When this is done, what processes have stuff in /usr open, and
what is it that they have?
Comment 5 Harald Hoyer 2001-02-06 12:14:09 EST
It happened to me when the module msp3400 for my Hauppage TV card is still
Comment 6 Bill Nottingham 2001-02-06 12:53:16 EST
Um, I'm confused. Why would the module being loaded hold /usr open?
Comment 7 Sammy 2001-02-06 16:01:53 EST
Created attachment 9179 [details]
Comment 8 Sammy 2001-02-06 16:02:19 EST
Hi!....I did the lsof thing with 5.60 and sent it into a file >>/usr/lsof.log
I am attaching the file.
Comment 9 Sammy 2001-02-06 16:17:48 EST
Created attachment 9181 [details]
Now lsof is in /bin and out is /bin/lsof.log
Comment 10 Travis Shugarts 2001-02-06 20:47:29 EST
The shell script /etc/init.d/functions is sourced into /etc/init.d/halt.  Lines
23-26 in /etc/init.d/functions sets the enviroment variable LANG to whatever is
in /etc/sysconfig/i18n.  If LANG is defined as anything but POSIX then libraries
located in /usr/lib/locale are loaded by sh.  In the case of /etc/init.d/halt
this will cause the /usr partition to become unmountable.

My solution would be to remove the offending commands from
/etc/init.d/functions, as any program that would need LANG set to something
other than POSIX should have it set by it's init script.
Comment 11 Bill Nottingham 2001-02-06 20:55:26 EST
You can't do that though; that breaks internationalization of the
init scripts.

halt most certainly can be special cased, though.
Comment 12 Bill Nottingham 2001-02-06 21:04:16 EST
What does your /etc/sysconfig/i18n look like?

I'm curious because we can't reproduce the same problem here; it's solved
by the fact that halt (or reboot) is called with LANG unset.
Comment 13 Travis Shugarts 2001-02-07 10:40:50 EST
My /etc/sysconfig/i18n has the following:


I'm using initscripts-5.59-1

Yes, /etc/rc does unset LANG before it calls halt, but LANG is reset by
/etc/init.d/functions when halt calls it.  

I think a fix could be to create a variable in halt, say NOLOCALE, then export
that var before calling functions.  Functions would then check if NOLOCALE is
set.  If it is set to yes (or something) then functions would skip over the
locale stuff (or set LANG=POSIX).  This way only halt and functions need to be
modified and internationalization of everything else would be unaffected.

Do you need internationalization for halt?  If you do then the only thing I can
think of would be to move the locale libs into /lib, as they are now required
for startup/shutdown.

Hope this helps
Comment 14 Sammy 2001-02-07 11:47:57 EST
Funny, I was about to come to the same conclusions since the two
scripts only differed in the LANG assignment. I am not an expert
though, so what is the way to fix it? Mine is:
# cat /etc/sysconfig/i18n
Comment 15 Bill Nottingham 2001-02-07 13:01:26 EST
The fact that it is reread in the halt script from /etc/init.d/functions
is actually irrelevant; at that point the shell is already started, and
it's not going to open new locale files.
Comment 16 Travis Shugarts 2001-02-07 15:17:25 EST
Your right about LANG, but LC_ALL will load new locale files.  Try typing in


Now do a lsof and you will see that the German locale files are loaded by bash
along with the ones for your default locale.

I've removed the LC_ALL="en_US and LINGUAS="en_US" entries from
/etc/sysconfig/i18n, and my test system is now cleanly unmounting /usr on halt.

/etc/sysconfig/i18n has only one line now:


Comment 17 Bill Nottingham 2001-02-07 16:15:05 EST
Will be fixed in kudzu-0.93-1; thanks for the idea!
Comment 18 Bill Nottingham 2001-02-07 16:15:35 EST
Aargh, wrong open window.
Comment 19 Bill Nottingham 2001-02-07 16:22:44 EST
Will be fixed in initscripts-5.63-1. That makes more sense. :)

Note You need to log in before you can comment on or make changes to this bug.