Bug 13896 - PID is created in /tmp/ instead of in /var/run/koha/...
Summary: PID is created in /tmp/ instead of in /var/run/koha/...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All Linux
: P5 - low trivial
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-23 21:51 UTC by Attila Kinali
Modified: 2015-12-03 22:03 UTC (History)
3 users (show)

See Also:
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 (1.07 KB, patch)
2015-03-23 22:03 UTC, Attila Kinali
Details | Diff | Splinter Review
Bug 13896: Fix pid file creation, use proper directory instead of /tmp/ (1.50 KB, patch)
2015-04-02 12:49 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 13896: Fix pid file creation, use proper directory instead of /tmp/ (1.59 KB, patch)
2015-04-03 17:07 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 13896: (QA followup) fix koha-{stop|restart}-zebra too (2.00 KB, patch)
2015-04-08 17:57 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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