Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 112059

Summary: shutdown order causes errors on diskless machines for services needing /usr
Product: Gentoo Linux Reporter: Jan <gentoo-bugzilla>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jan 2005-11-10 02:23:51 UTC
The shutdown order of services is not the inverse of their boot order (which 
starts the "boot" level first and then switches to "default"). This causes 
trouble for diskless machines, because /usr is unmounted before services like 
sshd are stopped. The current setup (baselayout 1.11.13-r1) seems to stop 
services based only on their dependency information, which loses the effects 
implicit in starting "boot" before "default".

Example machine service startup (some services omitted): 
- localmount
- netmount
(switch to runlevel 3)
- syslog
- acpid
- alsasound
- nfsmount
- nscd
- sshd

Service shutdown on same machine:
- alsasound
- syslog
- netmount
- nfsmount
- sshd [!!]
- acpid [!!]
- nscd [!!]

On this machine, sshd, acpid and nscd all fail because they can no longer access 
/usr. Note that alsasound succeeds because it happens to be shut down first 
(uses /usr/sbin/alsactl).

Workaround: Add "need netmount" to all affected services. That fixed things for 
me but is kind of ... ugly. And of course not maintenance-friendly, as it has to 
be adjusted for all updates and installation of additional services. 
A real fix would need to be done somewhere else.
(As a side note, the diskless-howto only lists a change to /etc/init.d/netmount 
for baselayout < 1.11.*)

Along similar lines, the skript "net.lo" uses xargs and "halt.sh" and "bootmisc" 
use find, which are in /usr/bin (bug #107260 already exists) - this causes no 
problems or error messages here because I already copied them to /bin to get the 
system this far.


Reproducible: Always
Steps to Reproduce:
Comment 1 Jan 2005-11-17 04:18:40 UTC
Just an update: 
As netmount and nfsmount both mount / unmount NFS entries in /etc/fstab, and 
because I want rpc.statd started, I did "rc-update del netmount" and put 
nfsmount in runlevel boot - better than having both try to unmount on shutdown. 
This meant changing "use netmount" in the init scripts to "use nfsmount", which 
is now in all scripts that depend on /usr (AFAIK).

This cuts errors down to one, which reports the failure to unmount "/" because 
it is busy (big surprise there).
Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-06-05 05:44:32 UTC
This should be fixed in baselayout-1.12.0 - re-open if you disagree