[Opensrf-commits] r2055 - in trunk: bin src (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 5 16:57:49 EDT 2010


Author: erickson
Date: 2010-11-05 16:57:43 -0400 (Fri, 05 Nov 2010)
New Revision: 2055

Modified:
   trunk/bin/osrf_ctl.sh.in
   trunk/src/Makefile.am
Log:

Patch from Michael Giarlo to integrate python service control into osrf_ctl.sh.

I made the following additional changes:

1. copy opensrf.py into the BIN dir during install when --enable-python is used.

2. osrf_ctl.sh will not attempt to control python services when python is not enabled for opensrf.



Modified: trunk/bin/osrf_ctl.sh.in
===================================================================
--- trunk/bin/osrf_ctl.sh.in	2010-11-05 15:15:53 UTC (rev 2054)
+++ trunk/bin/osrf_ctl.sh.in	2010-11-05 20:57:43 UTC (rev 2055)
@@ -48,6 +48,9 @@
     start_perl
     stop_perl
     restart_perl
+    start_python
+    stop_python
+    restart_python
     start_c
     stop_c
     restart_c
@@ -153,6 +156,25 @@
 	return 0;
 }
 
+start_python() {
+    [ ! $($OSRF_CONFIG | grep OSRF_PYTHON) ] && return;
+    echo "Starting OpenSRF Python";
+    OPT_LOCAL=""
+    [ "$OSRF_HOSTNAME" = "localhost" ] && OPT_LOCAL="-l"
+    opensrf.py -d -p $OPT_PID_DIR -f $OPT_CONFIG -a start_all $OPT_LOCAL
+    return 0;
+}
+
+stop_python() {
+    [ ! $($OSRF_CONFIG | grep OSRF_PYTHON) ] && return;
+    echo "Stopping OpenSRF Python";
+    OPT_LOCAL=""
+    [ "$OSRF_HOSTNAME" = "localhost" ] && OPT_LOCAL="-l"
+    opensrf.py -p $OPT_PID_DIR -f $OPT_CONFIG -a stop_all $OPT_LOCAL
+    sleep 1;
+    return 0;
+}
+
 start_perl() {
     echo "Starting OpenSRF Perl";
     opensrf-perl.pl --verbose --pid-dir $OPT_PID_DIR \
@@ -196,15 +218,18 @@
 	"start_perl") start_perl;;
 	"stop_perl") stop_perl;;
 	"restart_perl") stop_perl; start_perl;;
+	"start_python") start_python;;
+	"stop_python") stop_python;;
+	"restart_python") stop_python; start_python;;
 	"start_c") start_c;;
 	"stop_c") stop_c;;
 	"restart_c") stop_c; start_c;;
-	"start_osrf") start_perl; start_c;;
-	"stop_osrf") stop_perl; stop_c;;
-	"restart_osrf") stop_perl; stop_c; start_perl; start_c;;
-	"stop_all") stop_c; stop_perl; stop_router;;
-	"start_all") start_router; start_perl; start_c;;
-	"restart_all") stop_c; stop_perl; stop_router; start_router; start_perl; start_c;;
+	"start_osrf") start_perl; start_c; start_python;;
+	"stop_osrf") stop_python; stop_c; start_perl;;
+	"restart_osrf") stop_python; stop_c; stop_perl; start_perl; start_c; start_python;;
+	"stop_all") stop_python; stop_c; stop_perl; stop_router;;
+	"start_all") start_router; start_perl; start_c; start_python;;
+	"restart_all") stop_python; stop_c; stop_perl; stop_router; start_router; start_perl; start_c; start_python;;
 	*) usage;;
 esac;
 

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2010-11-05 15:15:53 UTC (rev 2054)
+++ trunk/src/Makefile.am	2010-11-05 20:57:43 UTC (rev 2055)
@@ -41,7 +41,11 @@
 
 if BUILDCORE
 MAYBE_CORE = libopensrf c-apps router srfsh gateway perl
+if BUILDPYTHON
+dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl @top_srcdir@/src/python/opensrf.py
+else
 dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl
+endif
 bin_SCRIPTS = @top_srcdir@/bin/osrf_config @top_srcdir@/bin/osrf_ctl.sh 
 dist_sysconf_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
 endif



More information about the opensrf-commits mailing list