1 |
It is perfectly legal to clear /var/run across reboots. Below is a bug |
2 |
from a user that ran into some trouble because an init script assumes that |
3 |
/var/run/package/ exists for its PID file: |
4 |
|
5 |
http://bugs.gentoo.org/show_bug.cgi?id=332397 |
6 |
|
7 |
A quick grep through the tree shows 73 packages that keepdirs |
8 |
/var/run/package/. Perhaps not all of them are bugs but they are |
9 |
certainly redundant. |
10 |
|
11 |
A mass bug-filing is probably not the correct thing to do but perhaps we |
12 |
should document somewhere (devmanual?) that keepdir'ing a temp location |
13 |
should be avoided. Suggestion: |
14 |
|
15 |
--- a/ebuild-writing/common-mistakes/text.xml |
16 |
+++ b/ebuild-writing/common-mistakes/text.xml |
17 |
@@ -41,6 +41,18 @@ elog "They are listed in the INSTALL file in /usr/share/doc/${PF}" |
18 |
</body> |
19 |
</section> |
20 |
|
21 |
+<section> |
22 |
+<title>Invalid use of <c>keepdir</c>in src_install</title> |
23 |
+<body> |
24 |
+The <c>keepdir</c> function should only be used to prevent directory removal |
25 |
+during uninstallation. In particular, using <c>keepdir</c> for a temporary |
26 |
+location - such as /var/run/package/ for a PID file - should be avoided. In |
27 |
+such a case, init script either should make sure that /var/run/package/ exists |
28 |
+or the package should use /var/run directly. Please note that /var/run can and |
29 |
+will be cleaned across reboots. |
30 |
+</body> |
31 |
+</section> |
32 |
+ |
33 |
</chapter> |
34 |
|
35 |
</guide> |
36 |
|
37 |
-- |
38 |
Eray |