[Pkg-sysvinit-devel] need advice: best place to mount /dev/pts early to allow startpar boot concurrency

Petter Reinholdtsen pere at hungry.com
Thu Jan 1 11:37:15 UTC 2009


[Kel Modderman]
> Hi sysvinit maintainers and maks,
> 
> I want to ask your advice about a technical improvement to allow startpar(8)
> to be functional early in earliest parts of local boot in runlevel S.

A year ago, I wrote a patch to get this working.  I see that I failed
to send it to #457896 , and only sent it to the startpar developers.
I've now passed it into #457896.

> startpar calls getpt(2) which requires that /dev/pts be
> mounted. /dev/pts is currently mounted by
> /etc/init.d/mountdevsubfs.sh after udev has run on local
> system. That is too late for startpar, as it wants to be the
> executor of all boot scripts. See #457896 for more details.

The patch uses a replacement implementation of getpt() which check for
/dev/pts/ every time, and not only the first time, and move to use the
glibc version when /dev/pts/ is mounted.

> So, initramfs is one possible place where /dev/pts can be mounted
> before root init takes over, and this works. I confirmed this by
> modifying /usr/share/initramfs-tools/scripts/init-bottom/udev to
> mount /dev/pts after moving /dev/ tmpfs to $rootmnt and rebuilding
> initrramfs cpio.

As not all systems uses initramfs, this is not an optimal solution. :(

> The question I would like to ask is, where in your opinion is the best place
> to mount /dev/pts:
> 
> 1) by the udev init-bottom script
> 2) by a new script which is run in init-bottom after the udev script
> 3) somewhere else, maybe /etc/init.d/rcS

Another option is to make all scripts executed before /dev/pts/ is
mounted "interactive", ie make sure none of them run in parallel.
Then startpar do not need to create pseudo terminals and we avoid the
problem.

Happy hacking,
-- 
Petter Reinholdtsen



More information about the Pkg-sysvinit-devel mailing list