summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/mounttmpfs
blob: 269ba74e24bf4501d0400a7df002c4d1dc480242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh /etc/rc.common

start()
{
	log 'Mounting temporary file systems'
	if ! mount | grep -Fq ' /run '; then
		mount -t tmpfs -o nodev,noexec,nosuid,mode=0755 \
			tmpfs /run
	fi
	[ -d /run/lock ] || mkdir -m 1777 /run/lock
	[ -d /run/shm ] || mkdir -m 1777 /run/shm
	if ! mount | grep -Fq ' /tmp '; then
		mount -t tmpfs -o nodev,nosuid,mode=1777 tmpfs /tmp
	fi
}

stop()
{
	log 'Unmounting temporary file systems'
	if mount | grep -Fq ' /run '; then
		umount /run
	fi
	if mount | grep -Fq ' /tmp '; then
		umount /tmp
	fi
}