Summary: | koha-common.init should implement the 'status' option switch | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Packaging | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | gitbot, gmcharlt, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 10617, 10622 | ||
Bug Blocks: | |||
Attachments: |
Bug 10624: 'status' option switch for the packages init script
Rebased. Added the PID parameter to daemon as it failed to check SIP servers were running otherwise. Bug 10624: 'status' option switch for the packages init script |
Description
Tomás Cohen Arazi (tcohen)
2013-07-22 17:33:59 UTC
Created attachment 20746 [details] [review] Bug 10624: 'status' option switch for the packages init script This patch makes the init script return the status of the relevant processes. It relies on the koha-list switches added by 10622, and is written on top of the patch from 10617 that cleaned the init script. To test: - Apply the patch (+ 10622 so the SIP part works), build package and install - Run $ service koha-common status Note: it can be tested just copying the debian/koha-common.init script to a server running koha-common instances and calling it $ ./koha-common.init status If you don't have a patched koha-list command it will fail to report SIP servers status. Regards To+ Sponsored-by: Universidad Nacional de Cordoba I think there's something confusing git going on here. I apply 10617 and 10622 and end up with a result that's different to what the patch says it should be. It might just be a matter of rebasing against current master. My patch ends up with: -# TODO: Implement this. It should check every daemon is running -# status) -# status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? -# ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 - exit 3 - ;; + ;; + esac + ;; +esac + ;; +esac + ;a_status + ;a_status +status +atus +status *) + +status *) +age: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 + exit 3 + ;; esac : Created attachment 21242 [details] [review] Rebased. To test: - Apply dependent patches: $ git bz apply 10617 $ git bz apply 10622 - Apply the patch, build package and install - Run $ service koha-common status Note: it can be tested just copying the debian/koha-common.init script to a server running koha-common instances and calling it $ ./koha-common.init status Sponsored-by: Universidad Nacional de Cordoba This doesn't seem to work for me, and I can't immediately tell why: $ sudo koha-start-sip test Starting SIP server for test $ sudo ./koha-common.init status Zebra server running for instace test:. SIP server running for instace test: failed! $ ps ax|grep -i sip 32410 ? S 0:00 daemon --name=test-koha-sip --errlog=/var/log/koha/test/sip-error.log --stdout=/var/log/koha/test/sip.log --output=/var/log/koha/test/sip-output.log --verbose=1 --respawn --delay=30 --pidfiles=/var/run/koha/test --user=test-koha.test-koha -- perl /usr/share/koha/lib/C4/SIP/SIPServer.pm /etc/koha/sites/test/SIPconfig.xml 32411 ? S 0:00 perl /usr/share/koha/lib/C4/SIP/SIPServer.pm /etc/koha/sites/test/SIPconfig.xml 32412 ? S 0:00 perl /usr/share/koha/lib/C4/SIP/SIPServer.pm /etc/koha/sites/test/SIPconfig.xml any ideas? Patch applied cleanly, go forth and signoff Created attachment 21513 [details] [review] Added the PID parameter to daemon as it failed to check SIP servers were running otherwise. $ sudo ./koha-common.init status Zebra server running for instace test:. SIP server running for instace test:. $ sudo kill 2170 2171 2179 $ sudo ./koha-common.init status Zebra server running for instace test:. SIP server running for instace test: failed! looks good. One note is that if you forget to use sudo, the error message is pretty obscure. We should probably fail cleaner. But that's not the fault of this. Created attachment 21706 [details] [review] Bug 10624: 'status' option switch for the packages init script This patch makes the init script return the status of the relevant processes. It relies on the koha-list switches added by 10622, and is written on top of the patch from 10617 that cleaned the init script. To test: - Apply the patch (+ 10622 so the SIP part works), build package and install - Run $ service koha-common status Note: it can be tested just copying the debian/koha-common.init script to a server running koha-common instances and calling it $ ./koha-common.init status If you don't have a patched koha-list command it will fail to report SIP servers status. Regards To+ Edit: added the PID parameter to daemon as it failed to check SIP servers were running otherwise. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Pushed to master. Thanks, Tomás! This patch has been pushed to 3.12.x, will be in 3.12.7. |