openrc/init.d/devfs.in
William Hubbs 3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00

39 lines
848 B
Plaintext

#!@SBINDIR@/openrc-run
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Mount system critical filesystems in /dev."
depend() {
use dev-mount
before dev
keyword -prefix -vserver -lxc
}
start() {
# Mount required stuff as user may not have then in /etc/fstab
for x in \
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
"tmpfs /dev/shm 1777 ,nodev shm" \
; do
set -- $x
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
mountinfo -q $2 && continue
if [ ! -d $2 ]; then
mkdir -m $3 -p $2 >/dev/null 2>&1 || \
ewarn "Could not create $2!"
fi
if [ -d $2 ]; then
ebegin "Mounting $2"
if ! fstabinfo --mount $2; then
mount -n -t $1 -o noexec,nosuid$4 $5 $2
fi
eend $?
fi
done
return 0
}