From 5e4d60cacabafccb0c1c11ccb4565f8d5251df7e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 28 Feb 2014 10:06:40 -0800 Subject: [PATCH] LP#1286248: remove references to osrf_ctl.sh This patch replaces references to osrf_ctl.sh, which is deprecated as of OpenSRF 2.3.0, with opensrf_control. It also names 2.3.0 as the minimum required version of OpenSRF. brick_ctl.sh gets the most changes as a consequence. In particular: * the stop_{c,perl}/[re]start_{c,perl} actions are removed, as osrf_control behaves exactly the same when stopping or starting services. * the -s option for working with a single service is now documented, and is restricted to the stop_osrf/[re]start_osrf actions It should be noted that for brick-based setups (and other kinds of multi-server setups) better control can be had by using opensrf_control directly. Signed-off-by: Galen Charlton Signed-off-by: Dan Wells --- Open-ILS/examples/opensrf.xml.example | 2 +- Open-ILS/src/support-scripts/brick_ctl.sh | 52 +++++++++++------------ build/tools/update.sh | 4 +- docs/installation/server_upgrade.txt | 4 +- docs/reports/reporter_add_data_source.txt | 10 +---- 5 files changed, 31 insertions(+), 41 deletions(-) diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index d2cb911ad9..8c021f3c10 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -1171,7 +1171,7 @@ vim:et:ts=4:sw=4: On Linux, the output of the following command is authoritative: $ perl -MNet::Domain -e 'print Net::Domain::hostfqdn() . "\n";' - To use 'localhost' instead, run osrf_ctl.sh with the -l flag + To use 'localhost' instead, run osrf_control with the --localhost flag --> diff --git a/Open-ILS/src/support-scripts/brick_ctl.sh b/Open-ILS/src/support-scripts/brick_ctl.sh index b456ef981b..61a3a7ee0d 100755 --- a/Open-ILS/src/support-scripts/brick_ctl.sh +++ b/Open-ILS/src/support-scripts/brick_ctl.sh @@ -42,18 +42,13 @@ function usage { echo " -f : the name of the bundle to fetch"; echo " -x : staff client build directory"; echo " -i : staff client build ID"; + echo " -s : apply action only to specified service"; echo "Actions:"; echo " fetch"; - echo " start_perl"; - echo " start_c"; echo " start_osrf"; echo " start_all"; - echo " stop_perl"; - echo " stop_c"; echo " stop_osrf"; echo " stop_all"; - echo " restart_perl"; - echo " restart_c"; echo " restart_osrf"; echo " restart_all"; echo " build"; @@ -94,14 +89,14 @@ else fi; fi; -[ -n "$OPT_LOCALHOST" ] && PERL_LOCALHOST_FLAG="--localhost"; +[ -n "$OPT_LOCALHOST" ] && SERVICE_LOCALHOST_FLAG="--localhost"; # make sure an action was specified [ -z "$OPT_ACTION" ] && usage; -LOCAL_BASE="osrf_ctl.sh $OPT_LOCALHOST -d $OSRF_PID_DIR -c $OSRF_CONFIG"; -DRONE_BASE=". /etc/profile && osrf_ctl.sh -d $OSRF_PID_DIR -c $OSRF_CONFIG"; -PERL_CONTROLLER="opensrf-perl.pl --verbose $PERL_LOCALHOST_FLAG --config $OSRF_CONFIG --pid-dir $OSRF_PID_DIR --action $OPT_ACTION --service $OPT_SERVICE"; +LOCAL_BASE="osrf_control $OPT_LOCALHOST --pid-dir $OSRF_PID_DIR --config $OSRF_CONFIG"; +DRONE_BASE=". /etc/profile && osrf_control --pid-dir $OSRF_PID_DIR --config $OSRF_CONFIG"; +SERVICE_CONTROLLER="osrf_control $SERVICE_LOCALHOST_FLAG --config $OSRF_CONFIG --pid-dir $OSRF_PID_DIR --service $OPT_SERVICE"; # ------------------------------------------------------------------- # Runs DRONE_ACT on the drones, then LOCAL_ACT on the local machine @@ -194,33 +189,34 @@ function fetch_build { # When other active languages are added, this script will need a language param # to determine which controller script to call. if [ -n "$OPT_SERVICE" ]; then - local_first "$PERL_CONTROLLER" "$PERL_CONTROLLER"; + case $OPT_ACTION in + "start_osrf") local_first "$SERVICE_CONTROLLER --start" \ + "$SERVICE_CONTROLLER --start";; + "stop_osrf") local_first "$SERVICE_CONTROLLER --stop" \ + "$SERVICE_CONTROLLER --stop";; + "restart_osrf") local_first "$SERVICE_CONTROLLER --restart" \ + "$SERVICE_CONTROLLER --restart";; + *) echo "Can only do start_osrf, stop_osrf, or restart_osrf for an individual service";; + esac; exit; fi; case $OPT_ACTION in - "start_osrf") local_first "$LOCAL_BASE -a start_perl && $LOCAL_BASE -a start_c" \ - "$DRONE_BASE -a start_perl && $DRONE_BASE -a start_c";; - - "stop_osrf") drone_first "$LOCAL_BASE -a stop_perl && $LOCAL_BASE -a stop_c" \ - "$DRONE_BASE -a stop_perl && $DRONE_BASE -a stop_c";; + "start_osrf") local_first "$LOCAL_BASE --start-services" \ + "$DRONE_BASE --start-services";; - "restart_osrf") local_first "$LOCAL_BASE -a restart_perl && $LOCAL_BASE -a restart_c" \ - "$DRONE_BASE -a restart_perl && $DRONE_BASE -a restart_c";; + "stop_osrf") drone_first "$LOCAL_BASE --stop-services" \ + "$DRONE_BASE --stop-services";; - "start_perl") local_first "$LOCAL_BASE -a start_perl" "$DRONE_BASE -a start_perl";; - "stop_perl") drone_first "$LOCAL_BASE -a stop_perl" "$DRONE_BASE -a stop_perl";; - "restart_perl") local_first "$LOCAL_BASE -a restart_perl" "$DRONE_BASE -a restart_perl";; - "start_c") local_first "$LOCAL_BASE -a start_c" "$DRONE_BASE -a start_c";; - "stop_c") drone_first "$LOCAL_BASE -a stop_c" "$DRONE_BASE -a stop_c";; - "restart_c") local_first "$LOCAL_BASE -a restart_c" "$DRONE_BASE -a restart_c";; + "restart_osrf") local_first "$LOCAL_BASE --restart-services" \ + "$DRONE_BASE --restart-services";; - "start_all") local_first "$LOCAL_BASE -a start_all" \ - "$DRONE_BASE -a start_perl && $DRONE_BASE -a start_c";; + "start_all") local_first "$LOCAL_BASE --start-all" \ + "$DRONE_BASE --start-services";; - "stop_all") drone_first "$LOCAL_BASE -a stop_all" \ - "$DRONE_BASE -a stop_perl && $DRONE_BASE -a stop_c";; + "stop_all") drone_first "$LOCAL_BASE --stop-all" \ + "$DRONE_BASE --stop-services";; "restart_all") $0 $OPT_LOCALHOST -a stop_all; $0 $OPT_LOCALHOST -a start_all;; "build") cd ~/ILS/ && make clean default_config all;; diff --git a/build/tools/update.sh b/build/tools/update.sh index 75f1f65b72..5c72850329 100755 --- a/build/tools/update.sh +++ b/build/tools/update.sh @@ -130,7 +130,7 @@ else fi sudo /etc/init.d/apache2 stop; -$INSTALL/bin/osrf_ctl.sh -l -a stop_all; +$INSTALL/bin/osrf_control --localhost --stop-all; # OpenSRF perl directory is not shared. update the drone # ssh 10.5.0.202 "./update_osrf_perl.sh"; @@ -195,7 +195,7 @@ ln -s current/server server; sudo chown -R opensrf:opensrf $OSRF $ILS -$INSTALL/bin/osrf_ctl.sh -l -a start_all +$INSTALL/bin/osrf_control --localhost --start-all sleep 2; cd $INSTALL/bin; ./autogen.sh ../conf/opensrf_core.xml; sudo /etc/init.d/apache2 start; diff --git a/docs/installation/server_upgrade.txt b/docs/installation/server_upgrade.txt index 0dd7888c56..c7c99dc659 100644 --- a/docs/installation/server_upgrade.txt +++ b/docs/installation/server_upgrade.txt @@ -36,7 +36,7 @@ as catalogue skins. + [source, bash] ----------------------------- -osrf_ctl.sh -l -a stop_all +osrf_control --localhost --stop-all ----------------------------- + .. Back up the /openils directory. @@ -197,7 +197,7 @@ Restart Evergreen and Test + [source, bash] -------------------------------------------------------------- -osrf_ctl.sh -l -a start_all +osrf_control --localhost --start-all -------------------------------------------------------------- + . As the opensrf user, run autogen to refresh the static organizational data files: diff --git a/docs/reports/reporter_add_data_source.txt b/docs/reports/reporter_add_data_source.txt index df97c45133..6cdb3ec6dc 100644 --- a/docs/reports/reporter_add_data_source.txt +++ b/docs/reports/reporter_add_data_source.txt @@ -238,16 +238,10 @@ the fieldmapper definitions. /openils/bin/autogen.sh ------------- + -. As the *opensrf* user, restart Perl services: +. As the *opensrf* user, restart services: + ------------- -osrf_ctl.sh -l -a restart_perl -------------- -+ -. As the *opensrf* user, restart C services: -+ -------------- -osrf_ctl.sh -l -a restart_c +osrf_control --localhost --restart-services ------------- + . As the *root* user, restart the Apache web server: -- 2.43.2