From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3ACF1138A78 for ; Sat, 16 Feb 2013 08:12:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C1DBFE0459; Sat, 16 Feb 2013 08:12:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5F2B4E0459 for ; Sat, 16 Feb 2013 08:12:25 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6FCD433D876 for ; Sat, 16 Feb 2013 08:12:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 03AF4E4073 for ; Sat, 16 Feb 2013 08:12:23 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1361001986.1831e433a03fa0e6c5be6b6a87af4550688f1c49.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/bootmisc.in X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 1831e433a03fa0e6c5be6b6a87af4550688f1c49 X-VCS-Branch: master Date: Sat, 16 Feb 2013 08:12:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a62e8fdb-dcb4-49cd-a272-d8d8ee2e84b5 X-Archives-Hash: 9f03878bcea89ba7be5cdeb2b14a8e6b commit: 1831e433a03fa0e6c5be6b6a87af4550688f1c49 Author: William Hubbs gmail com> AuthorDate: Sat Feb 16 06:48:36 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Feb 16 08:06:26 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1831e433 bootmisc: Skip cleaning /var/run or tmp directories if they are tmpfs Reported-by: walter pratyeka.org X-Gentoo-Bug: 454338 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=454338 --- init.d/bootmisc.in | 55 ++++++++++++++++++++++++++++----------------------- 1 files changed, 30 insertions(+), 25 deletions(-) diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index 6dabdfd..4fdb433 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -59,6 +59,34 @@ cleanup_tmp_dir() fi } +cleanup_var_run_dir() +{ + ebegin "Cleaning /var/run" + for x in $(find /var/run ! -type d ! -name utmp \ + ! -name random-seed ! -name dev.db \ + ! -name ld-elf.so.hints ! -name ld.so.hints); + do + # Clean stale sockets + if [ -S "$x" ]; then + if type fuser >/dev/null 2>&1; then + fuser "$x" >/dev/null 2>&1 || rm -- "$x" + else + rm -- "$x" + fi + fi + [ ! -f "$x" ] && continue + # Do not remove pidfiles of already running daemons + case "$x" in + *.pid) + start-stop-daemon --test --quiet \ + --stop --pidfile "$x" && continue + ;; + esac + rm -f -- "$x" + done + eend 0 +} + mkutmp() { : >"$1" @@ -138,36 +166,13 @@ start() [ -e /var/log/wtmp ] || mkutmp /var/log/wtmp eend 0 - ebegin "Cleaning /var/run" - for x in $(find /var/run ! -type d ! -name utmp \ - ! -name random-seed ! -name dev.db \ - ! -name ld-elf.so.hints ! -name ld.so.hints); - do - # Clean stale sockets - if [ -S "$x" ]; then - if type fuser >/dev/null 2>&1; then - fuser "$x" >/dev/null 2>&1 || rm -- "$x" - else - rm -- "$x" - fi - fi - [ ! -f "$x" ] && continue - # Do not remove pidfiles of already running daemons - case "$x" in - *.pid) - start-stop-daemon --test --quiet \ - --stop --pidfile "$x" && continue - ;; - esac - rm -f -- "$x" - done - eend 0 + mountinfo -q -f tmpfs /var/run || cleanup_var_run_dir fi # Clean up /tmp directories local tmp= for tmp in ${clean_tmp_dirs:-${wipe_tmp_dirs-/tmp}}; do - cleanup_tmp_dir "$tmp" + mountinfo -q -f tmpfs "$tmp" || cleanup_tmp_dir "$tmp" done if checkpath -W /tmp; then