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

Bug#65276: libc6: devpts not mounted



Package: libc6
Version: 2.1.3-10
Severity: important

Feel free to downgrade the priority on this report, I'm not quite
sure if it should be 'important' or 'normal'.

/etc/init.d/devpts.sh checks for the existance of devfs and devpts
in /proc/filesystems. If both are present, it assumes solution=devfs
and devpts is not mounted.

However the default in the 2.4 kernels if you compile in devfs is
that it is NOT mounted. So you end up without devpts and without devfs.

I think the script should actually check if devfs is mounted
instead of just checking if it was compiled in.

Here's a suggested rewrite of /etc/init.d/devpts.sh (seems to
work for me, not extensively tested):

#! /bin/sh

set -e

. /etc/default/devpts

[ "$(uname -s)" = "Linux" ] || exit 0

#
#	First find out if devpts is available. Also check if devfs
#	is already mounted - in that case we don't want to use devpts.
#
devpts_avail=$(grep -qci '\<devpts' /proc/filesystems || true)
devpts_mounted=$(grep -qci '/dev/pts' /proc/mounts || true)
devfs_mounted=$(grep -qci '\</dev\>.*devfs' /proc/mounts || true)

if [ $devfs_mounted = 0 ] && [ $devpts_avail != 0 ]
then
	#
	#	Create mountpoint and multiplexor device.
	#
	[ -d /dev/pts ] || mkdir --mode=755 /dev/pts
	[ -c /dev/ptmx ] || mknod --mode=666 /dev/ptmx c 5 2

	#
	#	Mount /dev/pts if needed.
	#
	if [ $devpts_mounted = 0 ]
	then
		mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
	fi
fi


Mike.



Reply to: