Ticket #206: bootmisc-skip-wiping-tmpfs-dirs.patch
File bootmisc-skip-wiping-tmpfs-dirs.patch, 1.9 KB (added by www.google.com/accounts/o8/id?id=aitoawkwxks0yu8ds1jw9yteckfs0bxwogv8lze, 9 months ago) |
---|
-
init.d/bootmisc.in
16 16 mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$ 17 17 } 18 18 19 is_dir_tmpfs() 20 { 21 [ -e "$1" ] && [ $(stat -fc%T "$1") = tmpfs ] 22 } 23 19 24 : ${wipe_tmp:=${WIPE_TMP:-yes}} 20 25 21 26 cleanup_tmp_dir() … … 98 103 [ -e /var/log/wtmp ] || mkutmp /var/log/wtmp 99 104 eend 0 100 105 101 ebegin "Cleaning /var/run" 102 for x in $(find /var/run ! -type d ! -name utmp \ 103 ! -name random-seed ! -name dev.db \ 104 ! -name ld-elf.so.hints ! -name ld.so.hints); 105 do 106 # Clean stale sockets 107 if [ -S "$x" ]; then 108 if type fuser >/dev/null 2>&1; then 109 fuser "$x" >/dev/null 2>&1 || rm -- "$x" 110 else 111 rm -- "$x" 106 if ! is_dir_tmpfs /var/run; then 107 ebegin "Cleaning /var/run" 108 for x in $(find /var/run ! -type d ! -name utmp \ 109 ! -name random-seed ! -name dev.db \ 110 ! -name ld-elf.so.hints ! -name ld.so.hints); 111 do 112 # Clean stale sockets 113 if [ -S "$x" ]; then 114 if type fuser >/dev/null 2>&1; then 115 fuser "$x" >/dev/null 2>&1 || rm -- "$x" 116 else 117 rm -- "$x" 118 fi 112 119 fi 113 fi114 [ ! -f "$x" ] && continue115 # Do not remove pidfiles of already running daemons116 case "$x" in117 *.pid)118 start-stop-daemon --test --quiet \119 --stop --pidfile "$x" && continue120 ;;121 esac122 rm -f -- "$x"123 done124 eend 0120 [ ! -f "$x" ] && continue 121 # Do not remove pidfiles of already running daemons 122 case "$x" in 123 *.pid) 124 start-stop-daemon --test --quiet \ 125 --stop --pidfile "$x" && continue 126 ;; 127 esac 128 rm -f -- "$x" 129 done 130 eend 0 131 fi 125 132 fi 126 133 127 134 # Clean up /tmp directories 128 135 local tmp= 129 136 for tmp in ${clean_tmp_dirs:-${wipe_tmp_dirs-/tmp}}; do 130 cleanup_tmp_dir "$tmp"137 ! is_dir_tmpfs "$tmp" && cleanup_tmp_dir "$tmp" 131 138 done 132 139 133 140 if dir_writeable /tmp; then