[Pkg-sysvinit-devel] Bug#584742: must create /dev/{pts, shm}/ by itself

Marco d'Itri md at Linux.IT
Sun Jun 6 09:20:04 UTC 2010


On Jun 06, Petter Reinholdtsen <pere at hungry.com> wrote:

> > The udev init script needs to stop creating these directories,
> Why is this?
Because in a few weeks it will be the only purpose left for
/lib/udev/create_static_nodes, and it was wrong in the first place
anyway to do it there.

> > please update mountdevsubfs.sh to create them if missing.
> Should not be too hard.  Do you have a tested patch proposal to
> implement this?
Here it is.

> > I also highly doubt that there is still any point in trying to
> > create /dev/ptmx.
> I do not know ptmx, so I do not know what it is used for.
It is the master device for the /dev/pts/ devices, but nowadays it is
either created by udev or already present in the existing static /dev.

-- 
ciao,
Marco
-------------- next part --------------
--- /etc/init.d/mountdevsubfs.sh	2009-09-11 11:30:42.000000000 +0200
+++ mountdevsubfs.sh	2010-06-06 11:15:44.332915505 +0200
@@ -31,47 +31,26 @@
 	#
 	# Mount a tmpfs on /dev/shm
 	#
+	if [ ! -d /dev/shm ]
+	then
+		mkdir --mode=755 /dev/shm
+		[ -x /sbin/restorecon ] && /sbin/restorecon /dev/shm
+	fi
 	SHM_OPT=
 	[ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT=",size=$SHM_SIZE"
 	domount tmpfs shmfs /dev/shm tmpfs -onosuid,nodev$SHM_OPT
 
 	#
-	# Mount /dev/pts. Create master ptmx node if needed.
-	#
-	# As of 2.5.68, devpts is not automounted when using devfs. So we
-	# mount devpts if it is compiled in (older devfs didn't require it
-	# to be compiled in at all).
+	# Mount /dev/pts
 	#
 	if [ "$KERNEL" = Linux ]
 	then
-		#
-		# Since kernel 2.5.something, devfs doesn't include
-		# a standard /dev/pts directory anymore. So if devfs
-		# is mounted on /dev we need to create that directory
-		# manually.
-		#
 		if [ ! -d /dev/pts ]
 		then
-			if grep -qs '/dev devfs' /proc/mounts
-			then
-				mkdir --mode=755 /dev/pts
-				[ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts
-			fi
-		fi
-		if [ -d /dev/pts ]
-		then
-			if [ ! -c /dev/ptmx ]
-			then
-				mknod --mode=666 /dev/ptmx c 5 2
-				ES=$?
-				if [ "$ES" != 0 ]
-				then
-					log_warning_msg "Failed making node /dev/ptmx with error code ${ES}."
-				fi
-				[ -x /sbin/restorecon ] && /sbin/restorecon /dev/ptmx
-			fi
-			domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
+			mkdir --mode=755 /dev/pts
+			[ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts
 		fi
+		domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
 	fi
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20100606/6edbed44/attachment-0001.pgp>


More information about the Pkg-sysvinit-devel mailing list