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

Re: about mounting /dev/pts



On Mar 26, Miquel van Smoorenburg <miquels@cistron.nl> wrote:

> 1. udev runs after mountvirtfs, umounts /dev/pts, mounts a new /dev,
>    remounts /dev/pts. If you use " umount -l" it won't even matter
>    if /dev/pts is busy, and since there is only one instance of devpts
>    anyway you'll remount the same instance. It will just work.
This is what udev will do, at least until we can think about something
better:

unmount_devpts() {
  if mountpoint -q /dev/pts/; then
    set -- $(IFS=' '; grep -E "^[^[:space:]]+ /dev/pts devpts " /proc/mounts)
    MOUNT_DEVPTS="$1 $2 -t $3 -o $4"

    umount -l /dev/pts/
  fi

  if mountpoint -q /dev/shm/; then
    set -- $(IFS=' '; grep -E "^[^[:space:]]+ /dev/shm tmpfs " /proc/mounts)
    MOUNT_DEVSHM="$1 $2 -t $3 -o $4"

    umount -l /dev/shm/
  fi
}

mount_devpts() {
  [ "$MOUNT_DEVPTS" ] && mount $MOUNT_DEVPTS
  [ "$MOUNT_DEVSHM" ] && mount $MOUNT_DEVSHM
}

-- 
ciao, |
Marco | [5391 teHprhXScCg32]



Reply to: