[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Placement of console device for `virtual-dev' package



In article <199710011324.OAA26728@ash.ukc.ac.uk>,
Charles Briscoe-Smith <cpb4@ukc.ac.uk> wrote:
>Hello fellow developers,
>
>I have a few small problems with the `virtual-dev' package I've
>uploaded to project/experimental...
>
>The package copies /dev to a ramdisk and mounts this over the top of
>the normal /dev in an rc.boot script.  It also adds an entry to
>/etc/fstab for the ramdisk so that umount can unmount it cleanly when
>the machine is shut down.
>
>Unfortunately, when init runs the shut-down rc script, it opens
>/dev/console and passes this as stdin/out/err to the script, and this
>prevents umount from unmounting /dev.

So the shutdown script should be modified. How about this:

if grep -q " /dev " /etc/mtab
then
	# /dev is on a seperate FS.
	exec 0>&- 1>&- 2>&-
	reopen=1
fi
umount -a
if [ "$reopen" ]
then
	exec 0<>/dev/console 1>&0 2>&0
fi

Mike.
-- 
| Miquel van Smoorenburg |                                                    |
| miquels@cistron.nl     | Owners of digital watches, your days are numbered. |
|     PGP fingerprint: FE 66 52 4F CD 59 A5 36  7F 39 8B 20 F1 D6 74 02       |


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: