Bug 18562 - Add koha-sip script to handle SIP servers for instances
Summary: Add koha-sip script to handle SIP servers for instances
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
: 19962 (view as bug list)
Depends on:
Blocks: 18114 22235 22396 22397
  Show dependency treegraph
 
Reported: 2017-05-09 18:05 UTC by Tomás Cohen Arazi
Modified: 2019-06-27 09:24 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
To ease multi-tenant sites maintenance, several handy scripts were introduced. For handling SIP servers, 3 scripts were introduced: koha-start-sip, koha-stop-sip and koha-enable-sip. This patch introduces a new script, koha-sip, that unifies those actions regarding SIP servers on a per instance base, through the use of option switches.
Version(s) released in:


Attachments
Bug 18562: Add koha-sip maintenance script (10.79 KB, patch)
2019-01-30 12:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 18562: Add manpage for koha-sip (3.68 KB, patch)
2019-01-30 12:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 18562: Tab completion in bash (2.48 KB, patch)
2019-01-30 12:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 18562: Add koha-sip maintenance script (10.86 KB, patch)
2019-01-30 13:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18562: Add manpage for koha-sip (3.75 KB, patch)
2019-01-30 13:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18562: Tab completion in bash (2.55 KB, patch)
2019-01-30 13:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18562: Add koha-sip maintenance script (10.91 KB, patch)
2019-02-11 08:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 18562: Add manpage for koha-sip (3.80 KB, patch)
2019-02-11 08:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 18562: Tab completion in bash (2.60 KB, patch)
2019-02-11 08:37 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2017-05-09 18:05:53 UTC

    
Comment 1 Tomás Cohen Arazi 2019-01-30 12:22:33 UTC
Created attachment 84511 [details] [review]
Bug 18562: Add koha-sip maintenance script

This patch introduces a single script to handle all actions on SIP
servers for Koha instances. It is intended to be a replacement for:

- koha-start-sip
- koha-stop-sip
- koha-enable-sip

It adds a function called is_sip_running to koha-functions.sh.

To test:
- Apply this patch
- Run:
  $ misc4dev/cp_debian_files.pl
  $ sudo koha-sip --enable kohadev
  $ sudo koha-sip --start kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --restart --verbose kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --stop kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is not running for kohadev
- Play with other combinations like enabling an already enabled
instance, etc. Remember you need to remove the
/etc/koha/sites/kohadev/SIPconfig.xml file so it is considered disabled.
- Sign off :-D
Comment 2 Tomás Cohen Arazi 2019-01-30 12:22:40 UTC
Created attachment 84512 [details] [review]
Bug 18562: Add manpage for koha-sip

This patch adds the manpage for koha-sip.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove xt/verify-debian-docbook.t
=> SUCCESS: Tests pass!
- Run:
  $ misc4dev/cp_debian_files.pl
  $ man koha-sip
=> SUCCESS: The man page shows correctly.
- Sign off :-D
Comment 3 Tomás Cohen Arazi 2019-01-30 12:22:45 UTC
Created attachment 84513 [details] [review]
Bug 18562: Tab completion in bash

This patch adds the fancy tab completion in bash.

To test:
- Run:
  $ source debian/koha-common.bash-completion
  $ sudo koha-sip <tab>
- Play with all the options
=> SUCCESS: The combinations make sense (e.g. only SIP-enabled instances
  are completed for --start, --stop, --restart, -v and --verbose are not
  offered if the other one is already in there, --enable only applies to
  SIP-disabled instances, etc).
- Sign off :-D
Comment 4 Kyle M Hall 2019-01-30 13:19:09 UTC
Created attachment 84521 [details] [review]
Bug 18562: Add koha-sip maintenance script

This patch introduces a single script to handle all actions on SIP
servers for Koha instances. It is intended to be a replacement for:

- koha-start-sip
- koha-stop-sip
- koha-enable-sip

It adds a function called is_sip_running to koha-functions.sh.

To test:
- Apply this patch
- Run:
  $ misc4dev/cp_debian_files.pl
  $ sudo koha-sip --enable kohadev
  $ sudo koha-sip --start kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --restart --verbose kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --stop kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is not running for kohadev
- Play with other combinations like enabling an already enabled
instance, etc. Remember you need to remove the
/etc/koha/sites/kohadev/SIPconfig.xml file so it is considered disabled.
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2019-01-30 13:19:37 UTC
Created attachment 84522 [details] [review]
Bug 18562: Add manpage for koha-sip

This patch adds the manpage for koha-sip.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove xt/verify-debian-docbook.t
=> SUCCESS: Tests pass!
- Run:
  $ misc4dev/cp_debian_files.pl
  $ man koha-sip
=> SUCCESS: The man page shows correctly.
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2019-01-30 13:19:40 UTC
Created attachment 84523 [details] [review]
Bug 18562: Tab completion in bash

This patch adds the fancy tab completion in bash.

To test:
- Run:
  $ source debian/koha-common.bash-completion
  $ sudo koha-sip <tab>
- Play with all the options
=> SUCCESS: The combinations make sense (e.g. only SIP-enabled instances
  are completed for --start, --stop, --restart, -v and --verbose are not
  offered if the other one is already in there, --enable only applies to
  SIP-disabled instances, etc).
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Martin Renvoize 2019-02-11 08:37:08 UTC
Created attachment 84951 [details] [review]
Bug 18562: Add koha-sip maintenance script

This patch introduces a single script to handle all actions on SIP
servers for Koha instances. It is intended to be a replacement for:

- koha-start-sip
- koha-stop-sip
- koha-enable-sip

It adds a function called is_sip_running to koha-functions.sh.

To test:
- Apply this patch
- Run:
  $ misc4dev/cp_debian_files.pl
  $ sudo koha-sip --enable kohadev
  $ sudo koha-sip --start kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --restart --verbose kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
  $ sudo koha-sip --stop kohadev
  $ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is not running for kohadev
- Play with other combinations like enabling an already enabled
instance, etc. Remember you need to remove the
/etc/koha/sites/kohadev/SIPconfig.xml file so it is considered disabled.
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2019-02-11 08:37:11 UTC
Created attachment 84952 [details] [review]
Bug 18562: Add manpage for koha-sip

This patch adds the manpage for koha-sip.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove xt/verify-debian-docbook.t
=> SUCCESS: Tests pass!
- Run:
  $ misc4dev/cp_debian_files.pl
  $ man koha-sip
=> SUCCESS: The man page shows correctly.
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-02-11 08:37:15 UTC
Created attachment 84953 [details] [review]
Bug 18562: Tab completion in bash

This patch adds the fancy tab completion in bash.

To test:
- Run:
  $ source debian/koha-common.bash-completion
  $ sudo koha-sip <tab>
- Play with all the options
=> SUCCESS: The combinations make sense (e.g. only SIP-enabled instances
  are completed for --start, --stop, --restart, -v and --verbose are not
  offered if the other one is already in there, --enable only applies to
  SIP-disabled instances, etc).
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2019-02-11 08:37:45 UTC
Nice complete patch which brings consistency.  Passing QA
Comment 11 Nick Clemens 2019-02-11 18:37:32 UTC
Awesome work all!

Pushed to master for 19.05
Comment 12 Martin Renvoize 2019-02-12 13:06:32 UTC
Pushed to 18.11.x for 18.11.03
Comment 13 Lucas Gass 2019-02-12 22:29:29 UTC
enhancement, wont backport to 18.05.x
Comment 14 Jonathan Druart 2019-02-22 12:39:34 UTC
sudo koha-sip --start --verbose kohadev
[ ok ] Starting Koha Zebra daemon for kohadev:.
Comment 15 Jonathan Druart 2019-02-22 12:40:29 UTC
Also, is that correct?

% sudo koha-sip --restart --verbose kohadev
Stopping SIP server for kohadev:.
Warning: SIP server already running for kohadev:.
Comment 16 Tomás Cohen Arazi 2019-02-22 15:11:30 UTC
(In reply to Jonathan Druart from comment #15)
> Also, is that correct?
> 
> % sudo koha-sip --restart --verbose kohadev
> Stopping SIP server for kohadev:.
> Warning: SIP server already running for kohadev:.

Dealt with on bug 22396. Thanks!
Comment 17 Tomás Cohen Arazi 2019-02-22 15:13:02 UTC
(In reply to Jonathan Druart from comment #14)
> sudo koha-sip --start --verbose kohadev
> [ ok ] Starting Koha Zebra daemon for kohadev:.

Dealt with on bug 22397. Thanks!
Comment 18 Magnus Enger 2019-03-19 08:05:29 UTC
*** Bug 19962 has been marked as a duplicate of this bug. ***