1 |
commit: 8be072628c6ef9dce9ddafb911096e7035ed5401 |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Jan 31 18:05:37 2013 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 31 18:11:53 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8be07262 |
7 |
|
8 |
remove cruft from /run directory |
9 |
|
10 |
The /run directory is a mount point for a tmpfs and should not contain |
11 |
any files or directories. This cleans out the /run/openrc |
12 |
symlink and any other files which were incorrectly placed in /run. |
13 |
Thanks to Ian Stakenvicius for pointing out this solution. |
14 |
|
15 |
--- |
16 |
init.d/bootmisc.in | 11 +++++++++++ |
17 |
1 files changed, 11 insertions(+), 0 deletions(-) |
18 |
|
19 |
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in |
20 |
index a96236a..6dabdfd 100644 |
21 |
--- a/init.d/bootmisc.in |
22 |
+++ b/init.d/bootmisc.in |
23 |
@@ -87,6 +87,16 @@ migrate_to_run() |
24 |
fi |
25 |
} |
26 |
|
27 |
+clean_run() |
28 |
+{ |
29 |
+ local dir |
30 |
+ dir=$(mktemp -d) |
31 |
+ mount --bind / $dir |
32 |
+ rm -rf $dir/run/* |
33 |
+ umount $dir |
34 |
+ rm -rf $dir |
35 |
+} |
36 |
+ |
37 |
start() |
38 |
{ |
39 |
# Remove any added console dirs |
40 |
@@ -115,6 +125,7 @@ start() |
41 |
if [ "$RC_UNAME" = Linux -a -d /run ]; then |
42 |
migrate_to_run /var/lock /run/lock |
43 |
migrate_to_run /var/run /run |
44 |
+ clean_run |
45 |
fi |
46 |
|
47 |
if checkpath -W /var/run; then |