forcing user opensrf to start the system
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Oct 2005 18:19:05 +0000 (18:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Oct 2005 18:19:05 +0000 (18:19 +0000)
added -pipe for faster compile
creating pid and sock dirs during install

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1922 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile
OpenSRF/bin/opensrf_all
OpenSRF/bin/opensrf_ctl
OpenSRF/src/Makefile
config.sh
install.sh

index 7fbb337..8fd5e60 100644 (file)
@@ -1,7 +1,7 @@
 
 export TMPDIR                  = $(TMP)/opensrf
 export LDFLAGS                 = -L $(TMPDIR) -L .
-export CFLAGS                  = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
+export CFLAGS                  = -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
                                                                -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
 
 export INCDIR = "$(INCLUDEDIR)/openils/"
index 3d4ec42..c337284 100755 (executable)
@@ -99,7 +99,7 @@ function startOpenSRF {
 
 function makeMeGo {
        
-       i=$(whoami) && [ "$i" == "root" ] && echo "Cannot run as root.  Exiting..." && exit;
+       i=$(whoami) && [ "$i" != "opensrf" ] && echo "Must be run as user 'opensrf'.  Exiting..." && exit;
        
        if [ ! -z "$JSERVER" ]; then
                echo "Starting Chop Chop, Jabber (jserver-c)...";
index e3578d7..9850277 100755 (executable)
@@ -12,7 +12,7 @@ function usage {
 
 function startSystem {
 
-       i=$(whoami) && [ "$i" == "root" ] && echo "Cannot run as root.  Exiting..." && exit;
+       i=$(whoami) && [ "$i" != "opensrf" ] && echo "Must be run as user 'opensrf'.  Exiting..." && exit;
 
        case $1 in 
        
index 6658318..47c86a9 100644 (file)
@@ -10,7 +10,7 @@ export INCLUDEDIR             = $(PREFIX)/include
 
 export LDLIBS                  += 
 export LDFLAGS                 += -L $(TMPDIR) -L . -L /opt/lib
-export CFLAGS                  += -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
+export CFLAGS                  += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
                                                                -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
 
 LIBOPENSRF                             = libopensrf.so
index 4e5b6b4..78be831 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -103,6 +103,8 @@ function writeConfig {
        _write "LIBDIR=\"$LIBDIR\"";
        _write "PERLDIR=\"$PERLDIR\"";
        _write "INCLUDEDIR=\"$INCLUDEDIR\"";
+       _write "SOCK=\"$PREFIX/var/sock\"";
+       _write "PID=\"$PREFIX/var/pid\"";
 
        _write "TMP=\"$TMP\"";
        _write "APXS2=\"$APXS2\"";
index 5a34a64..11b0398 100755 (executable)
@@ -75,6 +75,28 @@ function mkInstallDirs {
                fi
        fi
 
+       if installing; then
+               mkdir -p "$SOCK";
+               if [ "$?" != "0" ]; then
+                       fail "Error creating $SOCK";
+               fi
+
+               if [ ! -w "$SOCK" ]; then
+                       fail "We don't have write access to $SOCK";
+               fi
+       fi
+
+       if installing; then
+               mkdir -p "$PID";
+               if [ "$?" != "0" ]; then
+                       fail "Error creating $PID";
+               fi
+               if [ ! -w "$PID" ]; then
+                       fail "We don't have write access to $PID";
+               fi
+       fi
+
+
 
        # add the opensrf user and group
         if [ ! $(grep "^opensrf:" /etc/group) ]; then groupadd opensrf; fi