Bug 13896

Summary: PID is created in /tmp/ instead of in /var/run/koha/...
Product: Koha Reporter: Attila Kinali <attila>
Component: PackagingAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: chris, robin, tomascohen
Version: Main   
Hardware: All   
OS: Linux   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: patch
Bug 13896: Fix pid file creation, use proper directory instead of /tmp/
[PASSED QA] Bug 13896: Fix pid file creation, use proper directory instead of /tmp/
Bug 13896: (QA followup) fix koha-{stop|restart}-zebra too

Description Attila Kinali 2015-03-23 21:51:08 UTC
The daemon command uses /tmp/ as default directory for creating pid files unless the directory has been specified explicitly. This affects only the debian start scripts. The following patch fixes this

--- a/debian/scripts/koha-start-zebra
+++ b/debian/scripts/koha-start-zebra
@@ -40,6 +40,7 @@ start_zebra_instance()
         "/var/log/koha/$instancename/zebra-output.log"
     daemon \
         --name="$instancename-koha-zebra" \
+        --pidfiles="/var/run/koha/$instancename/" \
         --errlog="/var/log/koha/$instancename/zebra-error.log" \
         --stdout="/var/log/koha/$instancename/zebra.log" \
         --output="/var/log/koha/$instancename/zebra-output.log" \
Comment 1 Attila Kinali 2015-03-23 22:03:07 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-04-02 12:49:06 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall (khall) 2015-04-03 17:07:51 UTC
Created attachment 37460 [details] [review]
[PASSED QA] Bug 13896: Fix pid file creation, use proper directory instead of /tmp/

daemon uses by default /tmp/ for pid files, if they are unspecified.
Pass the right directory to daemon, so it knows where to put the pid file.

Signed-off-by: Attila Kinali <attila@kinali.ch>

TEST PLAN
---------
1) Roll a distribution and confirm it works.

OR

1) Hack all the /var directories to point to git directories
2) Add a dummy user for the instance name
3) sudo the script with the faked instance name.
   -- the daemon should be running and the pid file should be in
      the expected directory.

The first way is the proper way to test, I did the latter. :)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi (tcohen) 2015-04-08 17:57:46 UTC
Created attachment 37589 [details] [review]
Bug 13896: (QA followup) fix koha-{stop|restart}-zebra too

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2015-04-08 17:59:47 UTC
Patch pushed to master.

Thanks Attila! Congratulations for your patch!
Comment 6 Chris Cormack 2015-04-12 07:48:59 UTC
Pushed to 3.18.x will be in 3.18.6