Give opensrf.py reasonable defaults for options
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 9 Nov 2010 16:21:15 +0000 (16:21 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 9 Nov 2010 16:21:15 +0000 (16:21 +0000)
Rather than:
opensrf.py -l -d -f /openils/conf/opensrf_core.xml -p /openils/var/run/ -a start_all

you can now use:
opensrf.py -l -d -a start_all

Isn't that better? Note that we put the PIDs into PID_DIR/run/opensrf/
so that if/when OpenSRF is installed outside of the /openils/ prefix,
the names of the processes won't conflict with any other application PIDs.
Unlikely, but you never know.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2067 9efc2488-bf62-4759-914b-345cdb29e865

configure.ac
src/python/opensrf.py.in [moved from src/python/opensrf.py with 97% similarity]

index 7418c82..6cc828c 100644 (file)
@@ -340,6 +340,7 @@ if test "x$OSRF_INSTALL_CORE" = "xtrue"; then
                         src/libopensrf/Makefile
                         src/perl/Makefile
                         src/ports/strn_compat/Makefile
+                        src/python/opensrf.py
                         src/router/Makefile
                         src/srfsh/Makefile
                         bin/opensrf-perl.pl
similarity index 97%
rename from src/python/opensrf.py
rename to src/python/opensrf.py.in
index 27c5773..cc5d8f4 100755 (executable)
@@ -195,12 +195,13 @@ except getopt.GetoptError, e:
 
 options = dict(ops)
 
-if '-a' not in options or '-f' not in options:
+if '-a' not in options:
     do_help()
 
 action = options['-a']
-config_file = options['-f']
-pid_dir = options['-p']
+
+config_file = options.get('-f', '@CONF_DIR@/opensrf_core.xml')
+pid_dir = options.get('-p', '@PID_DIR@/run/opensrf')
 
 service_name = options.get('-s')
 config_ctx = options.get('-c', 'config.opensrf')