[Pkg-sysvinit-devel] udev breaks bootlogd
Nathanael Nerode
neroden at twcny.rr.com
Sat Dec 31 10:47:21 UTC 2005
reassign 237056 udev
severity 237056 grave
retitle 237056 udev initscript breaks bootlogd by leaving /dev/pts unmounted
found 237056 0.076-6
thanks
I've found the source of bug 237056. I think it's udev's responsibility,
but you can discuss that amongst yourselves.
bootlogd calls a routine in glibc which tries to get a UNIX98 PTY. If that
fails, it looks for a BSD (legacy) PTY. If that fails (perhaps because
they're not compiled into the kernel, because nothing much uses them), it
gives up and dies.
The problem lies in the rcS.d init scripts. On my system we have:
S01glibc.sh
S02mountvirtfs
S04udev
S05bootlogd
...
S36mountvirtfs
...
/dev/pts is mounted in mountvirtfs.
S05bootlogd runs as early as possible, but after mountvirtfs, because it
wants /dev/pts (and also /proc).
However, S04udev *unmounts* /dev/pts. And it's not remounted until S36.
Now, bootlogd runs after S04udev, presumably to guarantee that the console
device is available. But this means that /dev/pts isn't available.
As it says in S04udev:
# we need to unmount /dev/pts/ and remount it later over the tmpfs
Except it isn't remounted later, until S36. This is really bad because
it could easily break other programs launched in the initscripts in between,
as well. This is why I assigned this bug to udev at grave severity: it
breaks arbitrary other packages.
The bug might be solved in one of the following ways:
* have udev actually remount /dev/pts (and /dev/shm) at the end of its script
The natural solution. Creates code duplication, though. Unless udev
invokes /etc/mountvirtfs directly, in which case it has to watch out
and make sure that 'set -e' is disabled for the invocation.
* drop yet another invocation of mountvirtfs, between udev and bootlogd
Requires moving udev's script up to S03 to make room. Ugh.
* split mountvirtfs into multiple scripts, one for /proc and /sys which
runs before udev, and one for /dev/pts and /dev/shm which runs after.
* move bootlogd before udev
Requires more static devices, *and* might cause other problems (because
/dev would vanish under the running bootlogd and reappear); but has the
advantage of logging udev events. Probably the best long term solution,
but it's unlikely that it will work right now (anyone want to test it?)
As an aside, none of these solutions are robust to parallelized initscripts
-- but then neither are udev or bootlogd, period. Essentially
nothing can safely run at the same time as udev. Essentially all
initscripts should run after bootlogd for bootlogd to make sense -- but only
if bootlogd is present. And these aren't because the later scripts in any
sense 'require' them.
These two scripts fit very poorly into the parallelized initscripts
concept, and probably deserve special treatment for that reason; worth
thinking about. Perhaps every other initscript should be required to
depend on both udev and bootlogd, and dummy implementations should be
Provided for when the relevant program isn't installed. Or perhaps they
even deserve custom treatment by 'init', though I doubt it.
--
Nathanael Nerode <neroden at twcny.rr.com>
Make sure your vote will count.
http://www.verifiedvoting.org/
More information about the Pkg-sysvinit-devel
mailing list