#!/bin/bash # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/cleanfs,v 1.7 2008-12-22 22:01:15 niro Exp $ #%rlevels: 7:s #%start: 50 #%stop: #deps #%needs: #%before: #%after: source /etc/conf.d/rc source ${rc_functions} for dir in /tmp /var/run /var/lock do echo -e ${COLOREDSTAR}"Removing tmp files in ${dir}/* ..." for file in $(find ${dir} -type f) do [[ $(basename ${file}) = .keep ]] && continue rm -f ${file} done evaluate_retval done echo -e ${COLOREDSTAR}"Creating new /var/run/utmp ..." touch /var/run/utmp && chmod 644 /var/run/utmp evaluate_retval echo -e ${COLOREDSTAR}"Creating new /var/run/wtmp ..." touch /var/log/wtmp && chmod 644 /var/log/wtmp evaluate_retval echo -e ${COLOREDSTAR}"Removing possible /etc/nologin /fastboot and /forcefsck ..." rm -f /etc/nologin /fastboot /forcefsck evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0