Skip to content

Commit

Permalink
Bug 20234: Make maintenance scripts use koha-zebra instead of koha-*-…
Browse files Browse the repository at this point in the history
…zebra

This patch makes all maintenance scripts use **koha-zebra** instead of
the old **koha-*-zebra** scripts.

To test:
- Run:
  $ perl misc4dev/cp_debian_files.pl
  $ sudo service koha-common stop
=> SUCCESS: No errors and the Zebra-related sevices are stopped
  $ sudo service koha-common start
=> SUCCESS: No errors and the Zebra-related services are started
  $ sudo service koha-common restart
=> SUCCESS: No erros and Zebra-related services are running
  $ sudo koha-create --create-db test
=> SUCCESS: Instance created and zebra running for it
  $ sudo koha-disable test
=> SUCCESS: No errors and Zebra is stopped for instance test
  $ sudo koha-zebra --start test
  $ sudo koha-remove test
=> SUCCESS: No errors, instance removed, no Zebra running for test
- Sign off :-D

Sponsored-by: Orex Digital

Signed-off-by:  Hugo Agud [email protected]

Signed-off-by: Josef Moravec <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
  • Loading branch information
tomascohen authored and kidclamp committed Apr 6, 2018
1 parent 46cb6e9 commit 900f343
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions debian/koha-common.init
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ NAME="koha-common"
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x /usr/sbin/koha-start-zebra ] || exit 0
[ -x /usr/sbin/koha-zebra ] || exit 0

# Read configuration variable file if it is present
if [ -r /etc/default/$NAME ]; then
Expand Down Expand Up @@ -55,7 +55,7 @@ do_start()
{
# We insure all required directories exist, including disabled ones.
koha-create-dirs $(koha-list)
koha-start-zebra $(koha-list --enabled)
koha-zebra --start $(koha-list --enabled)
koha-start-sip $(koha-list --enabled)
koha-plack --start $(koha-list --enabled --plack)

Expand All @@ -70,7 +70,7 @@ do_start()
do_stop()
{
# We stop everything, including disabled ones.
koha-stop-zebra $(koha-list) || true
koha-zebra --stop $(koha-list) || true
koha-stop-sip $(koha-list) || true
koha-plack --stop --quiet $(koha-list --enabled --plack)

Expand All @@ -83,7 +83,7 @@ do_stop()
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
koha-restart-zebra $(koha-list --enabled)
koha-zebra --restart $(koha-list --enabled)
koha-stop-sip $(koha-list) || true
koha-start-sip $(koha-list --enabled)
koha-plack --restart --quiet $(koha-list --enabled --plack)
Expand Down
4 changes: 2 additions & 2 deletions debian/koha-common.logrotate
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
notifempty
sharedscripts
prerotate
/usr/sbin/koha-stop-zebra $(koha-list --enabled) > /dev/null
/usr/sbin/koha-zebra --stop $(koha-list --enabled) > /dev/null
/usr/sbin/koha-plack --stop --quiet $(koha-list --enabled --plack) > /dev/null
endscript
postrotate
/etc/init.d/apache2 reload > /dev/null
/usr/sbin/koha-plack --start --quiet $(koha-list --enabled --plack) > /dev/null
/usr/sbin/koha-start-zebra $(koha-list --enabled) > /dev/null
/usr/sbin/koha-zebra --start $(koha-list --enabled) > /dev/null
endscript
}
2 changes: 1 addition & 1 deletion debian/scripts/koha-create
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ then
service apache2 restart
# Start Zebra.
koha-start-zebra "$name"
koha-zebra --start "$name"
if [ "$USE_INDEXER_DAEMON" = "yes" ]; then
# Start Indexer daemon
Expand Down
2 changes: 1 addition & 1 deletion debian/scripts/koha-disable
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ do
koha-stop-sip $name
fi
if is_zebra_running $name; then
koha-stop-zebra $name
koha-zebra --stop $name
fi
if is_indexer_running $name; then
koha-indexer --stop $name
Expand Down
2 changes: 1 addition & 1 deletion debian/scripts/koha-remove
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ eof

# Stop the Zebra server if needed
if is_zebra_running $name; then
koha-stop-zebra $name || /bin/true
koha-zebra --stop $name || /bin/true
fi
# Stop the indexer daemon if needed
if is_indexer_running $name; then
Expand Down

0 comments on commit 900f343

Please sign in to comment.