void-packages/templates/initscripts/files/rc.d/cleartmp
Juan RP a3190ec48c initscripts: misc changes, bump to 2009-03.
--HG--
extra : convert_revision : 97fb9127cb91659331f1574a19a8871fed30a0ab
2009-03-26 10:07:50 +01:00

29 lines
548 B
Bash
Executable file

#!/bin/sh
#
# PROVIDE: cleartmp
# REQUIRE: SERVERS random_seed
# BEFORE: NETWORKING
$_rc_subr_loaded . /etc/rc.subr
name="cleartmp"
start_cmd="cleartmp_start"
stop_cmd=":"
cleartmp_start()
{
echo -n "Clearing temporary files... "
rm -f /etc/nologin &>/dev/null
rm -f /etc/shutdownpid &>/dev/null
rm -f /var/lock/* &>/dev/null
rm -rf /tmp/* &>/dev/null
rm -f /forcefsck &>/dev/null
(cd /var/run && find . ! -type d -exec rm -f -- {} \; )
: > /var/run/utmp
chmod 0664 /var/run/utmp
show_rval
}
load_rc_config $name
run_rc_command "$1"