bridge(4): document net.link.bridge.pfil_onlyip
[dragonfly.git] / etc / rc.d / cleartmp
bloba51e017f2fa3b1078c4fc0b9bd6da6c199303a59
1 #!/bin/sh
3 # $NetBSD: cleartmp,v 1.4 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/cleartmp,v 1.4 2002/10/12 10:31:31 schweikh Exp $
7 # PROVIDE: cleartmp
8 # REQUIRE: SERVERS
9 # BEFORE: DAEMON
11 . /etc/rc.subr
13 name="cleartmp"
14 rcvar=`set_rcvar clear_tmp`
15 start_cmd="cleartmp_start"
16 stop_cmd=":"
18 cleartmp_start()
20 echo "Clearing /tmp."
22 # Prune quickly with one rm, then use find to clean up
23 # the rest. Exceptions are lost+found/ (which is preserved
24 # but its contents are removed), quota.{group,user}, and
25 # snapshots/ (left untouched). This is not needed with mfs
26 # /tmp, but doesn't hurt anything.
28 (cd /tmp && rm -rf [a-km-prt-zA-Z]* &&
29 find -x . ! -name . ! -name lost+found \
30 ! -name snapshots ! -path "./snapshots/*" \
31 ! -name quota.user ! -name quota.group \
32 -exec rm -rf -- {} \; -type d -prune)
34 # Remove X lock files, since they will prevent you from restarting X.
35 rm -rf /tmp/.X*-lock /tmp/.X11-unix
36 mkdir -m 1777 /tmp/.X11-unix
39 load_rc_config $name
40 run_rc_command "$1"