diff options
author | Roland McGrath <roland@gnu.org> | 1999-06-22 23:58:48 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-06-22 23:58:48 +0000 |
commit | a400ee753527ee9b838d27169ac3fb8cb8a1737a (patch) | |
tree | 98510691478a978f8bc48154ffab5b3019611d2f /daemons | |
parent | e22b124496406042b2c5cc0e750f37299c5ff521 (diff) |
1999-06-22 Roland McGrath <roland@baalperazim.frob.com>
* rc.sh: Clean /tmp using special hackery to nuke translators.
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/rc.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/daemons/rc.sh b/daemons/rc.sh index 001a4f8b..f273bb36 100644 --- a/daemons/rc.sh +++ b/daemons/rc.sh @@ -48,7 +48,31 @@ echo -n cleaning up left over files... rm -f /etc/nologin rm -f /var/lock/LCK.* if test -d /tmp; then - (cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -rf {} \; ) + + # Forcibly remove all translators in the directory. + # It is then safe to attempt to remove files and descend directories. + function remove_translators() { + local f + for f; do + f="./$f" + settrans -pagfS "$f" + if [ -L "$f" ] || [ ! -d "$f" ]; then + rm "$f" + else + remove_translators "$f" + rmdir "$f" + fi + done + } + + (cd /tmp + for f in * .[!.] .??*; do + case "$f" in + 'lost+found'|'quotas') ;; + *) remove_translators "$f" + esac + done) + fi if test -d /var/run; then (cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; }) |