[Pkg-sysvinit-devel] Bug#345741: Would a restricted form of the INIT_PROG feature suffice?

Dana How danahow at gmail.com
Thu Jan 12 22:56:52 UTC 2006


On 1/12/06, Thomas Hood <jdthood at yahoo.co.uk> wrote:
> Dana How wrote:
> > Let me know what you think of it.
> Your unionfs scenario leads me to ask this: why not just bind mount a
> different program on top of /sbin/init and do "telinit u"?

That is, to switch from ro /sbin/init on fs you want to umount
to /etc/init that won't be umounted:

cat >/etc/init.sh <<EOT
#!/bin/bash
LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=$PATH; export PATH
exec $LD_LINUX /etc/init \$*
EOT
chmod +x /etc/init.sh
mount --bind /etc/init.sh /sbin/init
telinit -u
sleep 2
umount /sbin/init

It looks like this might work.  I need the bash script trampoline
anyway to redirect ld-linux.so.2 and the libraries it loads
(since /lib could get umount'd too ;-) ).

I'll try this over the weekend.
If this works,  then when #345719 makes it into
testing/unstable I'm all set.

Thanks!
--
Dana L. How  danahow at gmail.com  +1 650 804 5991 cell




More information about the Pkg-sysvinit-devel mailing list