From 8be072628c6ef9dce9ddafb911096e7035ed5401 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 31 Jan 2013 12:05:37 -0600 Subject: remove cruft from /run directory The /run directory is a mount point for a tmpfs and should not contain any files or directories. This cleans out the /run/openrc symlink and any other files which were incorrectly placed in /run. Thanks to Ian Stakenvicius for pointing out this solution. --- init.d/bootmisc.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index a96236ac..6dabdfd6 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -87,6 +87,16 @@ migrate_to_run() fi } +clean_run() +{ + local dir + dir=$(mktemp -d) + mount --bind / $dir + rm -rf $dir/run/* + umount $dir + rm -rf $dir +} + start() { # Remove any added console dirs @@ -115,6 +125,7 @@ start() if [ "$RC_UNAME" = Linux -a -d /run ]; then migrate_to_run /var/lock /run/lock migrate_to_run /var/run /run + clean_run fi if checkpath -W /var/run; then -- cgit v1.2.3