ssm-services/init.d/devfs

33 lines
887 B
Plaintext
Raw Normal View History

2013-09-28 23:32:39 +00:00
#!/usr/bin/env watchman
# As of spark-rc 1.1.5, this script is deprecated
2013-09-28 23:32:39 +00:00
service_type='oneshot'
cfg_mounts+=( 'dev:devtmpfs:defaults:/dev' )
cfg_mounts+=( '/dev/pts:devpts:noexec,nosuid,gid=5,mode=0620:/dev/pts' )
cfg_mounts+=( '/dev/mqueue:mqueue:noexec,nosuid,nodev:/dev/mqueue' )
cfg_mounts+=( 'tmpfs:tmpfs:defaults,mode=0777:/dev/shm' )
start() {
for m in ${cfg_mounts[@]}; do
fs_dev=`echo "$m" | cut -d':' -f1`
fs_type=`echo "$m" | cut -d':' -f2`
fs_opts=`echo "$m" | cut -d':' -f3`
fs_mountpoint=`echo "$m" | cut -d':' -f4`
mountpoint -q "$fs_mountpoint" || {
[[ -d "$fs_mountpoint" ]] || { mkdir "$fs_mountpoint"; }
mount "$fs_dev" -n -t "$fs_type" -o "$fs_opts" "$fs_mountpoint"
}
done
}
stop() {
for m in "${cfg_mounts[@]}"; do
fs_mountpoint=`echo "$m" | cut -d ':' -f 4`
mountpoint -q "$fs_mountpoint" && {
umount "$fs_mountpoint"
}
done
}