My company is currently developing a Linux-based embedded device for
installation in airliners. The OS is based on SuSE 8.2 Pro's Minimum
System install.
We need to support networking via PCMCIA NICs. Things are working
fine except that if a PCMCIA network interface is up when the system
does a shutdown or reboot, the system hangs at:
Shutting down PCMCIA
It so happens the network card we're using is for Token-Ring (the IBM
16/4 Token-Ring CardBus Adapter), but I have no reason to believe the
same thing wouldn't happen with an Ethernet or wireless LAN card
(don't have either available to test with right now, but found threads
in Google Groups with people reporting this same problem with those
types of cards -- no solutions in any of those threads,
unfortunately).
PCMCIA_SYSTEM is set to the default of "kernel" in
/etc/sysconfig/pcmcia. (I tried setting it to "external" to see if
that would fix the problem, but with that setting the card didn't come
up at boot time.)
The card is configured via /etc/sysconfig/network/ifcfg-tr-pcmcia,
with STARTMODE in there set to 'hotplug'.
Since the hang wouldn't occur if the Token-Ring cable wasn't plugged
into the hub/concentrator, I tried manually taking down the PCMCIA
card interface with an 'ifdown tr0' prior to rebooting, and sure
enough, in this case "Shutting down PCMCIA" doesn't hang.
Thinking about it, it does seem wrong that PCMCIA gets taken down
prior to the network interfaces -- even if it didn't hang while
shutting down PCMCIA, you can imagine the shutdown of the PCMCIA
network interface(s) hanging or at least complaining because the
PCMCIA subsystem would be no longer working by that point.
I tried manually renaming the /etc/init.d/rc3.d/K##network script to
take place before K##pcmcia, and that fixed the problem, but of course
next time chkconfig gets run, the links get reordered to match the
dependencies in the INIT INFO section of the init.d scripts.
I'd love to be able to put "Required-Stop: network" in
/etc/init.d/pcmcia so that chkconfig could fix that K* order
automatically, but as documented in insserv(8):
the Required-Stop, X-UnitedLinux-Should-
Stop, and Default-Stop are ignored in SuSE Linux, because
the SuSE boot script concept uses a differential link
scheme (see init.d(7)).
First off, it's bogus for those *-Stop lines to appear in the SuSE
init.d scripts if they aren't functional. Also, that "differential
link scheme" isn't really explained anywhere -- I read the chkconfig,
init.d, and insserv man pages as well as the "SuSE Linux Boot Concept"
chapter of the 8.2 Administration Guide book, and there are no details
on that.
But I understand that the upshot is that init.d script always shut
down in reverse order of startup. I tried to change the INIT INFO
sections to get pcmcia to start up before network, but to avoid
dependency loops I would have to make the following changes:
network: add "Required-Start: pcmcia"
pcmcia: add "Required-Start: network",
remove "Required-Start: syslog" and
"X-UnitedLinux-Should-Stop: hotplug"
Is it safe to change all those dependencies? I assume they're there
for a reason...
Since I can't get chkconfig to do what I want, for now I've added a
call to "/etc/init.d/network stop" at the top of the "stop)" section
in 'pcmcia', but that's a pretty cheesy kludge.
What's the *right* fix for this?
--
Dan Harkless
(E-Mail Removed)
http://harkless.org/dan/