Bug 4873 - Debian packaging should avoid /var/run and /var/lock in the package
Summary: Debian packaging should avoid /var/run and /var/lock in the package
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: 3.4
Hardware: All All
: PATCH-Sent (DO NOT USE) major (vote)
Assignee: Robin Sheat
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 01:33 UTC by Lars Wirzenius
Modified: 2012-10-25 23:10 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 4873 - Ensure that the required directories exist on init (1.02 KB, patch)
2011-07-22 03:36 UTC, Robin Sheat
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wirzenius 2010-06-10 01:33:49 UTC
Debian policy allows the system to have /var/run and /var/lock on ramdisks. It is thus not acceptable for a package to include subdirectories in those directories. Instead, the directories should be created in init.d scripts.
Comment 1 John.Seymour 2011-07-22 01:26:40 UTC
In the current version of debian testing the  /var/run and /var/lock directories are recreated at each boot (this is part of the migration from /var/run to /run). This means that the koha directories are not available after each boot. I fixed this issue by modifying the /etc/init.d/koha-common script as follows.

--- koha-common.orig    2011-07-22 11:07:58.000000000 +1000
+++ koha-common 2011-07-22 11:06:43.000000000 +1000
@@ -42,6 +42,8 @@
 #
 do_start()
 {
+    # We insure all required directories exist, including disabled ones.
+    koha-create-dirs $(koha-list)
     koha-start-zebra $(koha-list --enabled)
 }

yours
John
Comment 2 Robin Sheat 2011-07-22 01:35:04 UTC
This will have the nice side effect of fixing installations on Ubuntu that refuse to come up after boot. I'll have a look to make sure there's nothing funny that this would cause, but I expect it'll be a quick signoff.
Comment 3 Robin Sheat 2011-07-22 03:36:19 UTC
Created attachment 4707 [details] [review]
Bug 4873 - Ensure that the required directories exist on init

As systems (Ubuntu already, Debian testing is doing it too) move to
ramdisking /var/run and /var/lock, or otherwise clearing them on boot,
we need to ensure that they're there when we need them. This patch
autocreates any directories that are missing when the init script runs.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Comment 4 Chris Cormack 2011-07-28 02:07:16 UTC
Patch for packages, pushed
Comment 5 Robin Sheat 2011-09-20 02:38:23 UTC
Patch is in both master and 3.4.x (and has been for a while now.)