Nuke unused macro and comment
[dragonfly.git] / etc / rc.d / cleartmp
blobcbcda8da551ac672fb52d278736ea55f67b934c4
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 $
5 # $DragonFly: src/etc/rc.d/cleartmp,v 1.5 2005/11/19 21:47:32 swildner Exp $
8 # PROVIDE: cleartmp
9 # REQUIRE: mountcritremote
10 # BEFORE: DAEMON
12 . /etc/rc.subr
14 name="cleartmp"
15 rcvar=`set_rcvar clear_tmp`
16 start_cmd="cleartmp_start"
17 stop_cmd=":"
19 cleartmp_start()
21 echo "Clearing /tmp."
23 # Prune quickly with one rm, then use find to clean up
24 # /tmp/[lq]* (this is not needed with mfs /tmp, but
25 # doesn't hurt anything).
27 (cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
28 find -x . ! -name . ! -name lost+found ! -name quota.user \
29 ! -name quota.group -exec rm -rf -- {} \; -type d -prune)
31 # Remove X lock files, since they will prevent you from
32 # restarting X
34 rm -f /tmp/.X*-lock
35 rm -fr /tmp/.X11-unix
36 mkdir -m 1777 /tmp/.X11-unix
39 load_rc_config $name
40 run_rc_command "$1"