aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-01-31 12:05:37 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-01-31 12:11:53 -0600
commit8be072628c6ef9dce9ddafb911096e7035ed5401 (patch)
tree4fba6c54dc25ac229242b27ebd8c81ca6508dabe
parent8328b8836021e638a9b18640df4eb9f64bdcc812 (diff)
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.
-rw-r--r--init.d/bootmisc.in11
1 files changed, 11 insertions, 0 deletions
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