diff options
-rwxr-xr-x | sbin/init.linux.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sbin/init.linux.sh b/sbin/init.linux.sh index d144d84..ca4fca5 100755 --- a/sbin/init.linux.sh +++ b/sbin/init.linux.sh @@ -28,6 +28,22 @@ if [[ ! -e /proc/self ]]; then mount -t proc none /proc fi +# OpenVZ also needs devpts for vzctl enter +if [[ ! -e /dev/pts/0 ]]; then + have_devpts="$(awk '($2 == "devpts") { print "yes"; exit 0 }' /proc/filesystems)" + + if [ "${have_devpts}" = "yes" ]; then + # Make sure we have /dev/pts + mkdir -p /dev/pts &>/dev/null || \ + ewarn "Could not create /dev/pts!" + + if [[ -d /dev/pts ]]; then + ebegin "Mounting devpts at /dev/pts" + mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts + eend $? + fi + fi +fi source "${svclib}"/sh/init-common-post.sh |