From 339ac28d47a466d2fd0009c24fe0385cb5326479 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 28 Feb 2014 09:33:19 -0800 Subject: [PATCH] LP#1286248: remove osrf_ctl.sh As osrf_ctl.sh was deprecated in favor of osrf_control, this patch removes the deprecated script entirely. Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- .gitignore | 1 - bin/osrf_ctl.sh.in | 102 --------------------------------------------- configure.ac | 3 +- src/Makefile.am | 2 +- 4 files changed, 2 insertions(+), 106 deletions(-) delete mode 100755 bin/osrf_ctl.sh.in diff --git a/.gitignore b/.gitignore index a370737..99021f3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ aclocal.m4 autom4te.cache/ bin/opensrf-perl.pl bin/osrf_config -bin/osrf_ctl.sh compile config.guess config.log diff --git a/bin/osrf_ctl.sh.in b/bin/osrf_ctl.sh.in deleted file mode 100755 index aa6d623..0000000 --- a/bin/osrf_ctl.sh.in +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# Strictness to avoid folly -set -e -set -u - -prefix=@prefix@ -exec_prefix=@exec_prefix@ - -OPT_ACTION="" -OPT_CONFIG="" -OPT_PID_DIR="" -OSRF_HOSTNAME="" - -# --------------------------------------------------------------------------- -# Make sure we're running as the correct user -# --------------------------------------------------------------------------- -[ $(whoami) != 'opensrf' ] && echo 'Must run as user "opensrf"' && exit; - - -usage() { - cat << EOF - -usage: $0 [OPTION]... -c -a - -Mandatory parameters: - -a action to perform - -Optional parameters:"; - -c full path to C configuration file (opensrf_core.xml) - -d store PID files in this directory - -l accept 'localhost' as the fully-qualified domain name - -Actions include: - stop_all - start_all - restart_all - -Examples: - $0 -a restart_all - $0 -l -c opensrf_core.xml -a restart_all - -EOF -} - -# --------------------------------------------------------------------------- -# Load the command line options and set the global vars -# --------------------------------------------------------------------------- -while getopts "a:d:c:s:k:lh" flag; do - case $flag in - "a") OPT_ACTION="$OPTARG";; - "c") OPT_CONFIG="$OPTARG";; - "d") OPT_PID_DIR="$OPTARG";; - "l") export OSRF_HOSTNAME="localhost";; - "h"|*) usage;; - esac; -done - -OSRF_CONFIG="@bindir@/osrf_config" -[ ! -f "$OSRF_CONFIG" ] && OSRF_CONFIG=`which osrf_config` - -[ -z "$OPT_CONFIG" ] && OPT_CONFIG=`$OSRF_CONFIG --sysconfdir`/opensrf_core.xml; -if [ ! -r "$OPT_CONFIG" ]; then - echo "Please specify the location of the opensrf_core.xml file using the -c flag"; - exit 1; -fi; -[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=`$OSRF_CONFIG --localstatedir`/run/opensrf; -[ -z "$OPT_ACTION" ] && usage; - - -start_all() { - opensrf-perl.pl --pid-dir $OPT_PID_DIR \ - --config $OPT_CONFIG --start-all --settings-startup-pause 3 -} - -stop_all() { - opensrf-perl.pl --pid-dir $OPT_PID_DIR --config $OPT_CONFIG --stop-all -} - -# --------------------------------------------------------------------------- -# Do the requested action -# --------------------------------------------------------------------------- -echo "$0 is deprecated. Use osrf_control instead" - -case $OPT_ACTION in - "stop_all") stop_all;; - "start_all") start_all;; - "restart_all") stop_all; start_all;; - *) usage;; -esac; - - diff --git a/configure.ac b/configure.ac index 289c356..dd5d3a7 100644 --- a/configure.ac +++ b/configure.ac @@ -375,8 +375,7 @@ if test "x$OSRF_INSTALL_CORE" = "xtrue"; then src/srfsh/Makefile tests/Makefile bin/opensrf-perl.pl - bin/osrf_config - bin/osrf_ctl.sh]) + bin/osrf_config]) fi AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 846eeb9..282f577 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,7 @@ dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl @top_srcdir@/src/python/open else dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl endif -bin_SCRIPTS = @top_srcdir@/bin/osrf_config @top_srcdir@/bin/osrf_ctl.sh +bin_SCRIPTS = @top_srcdir@/bin/osrf_config dist_sysconf_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example endif -- 2.43.2