not allowing the code to be run as root
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Oct 2005 18:00:25 +0000 (18:00 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Oct 2005 18:00:25 +0000 (18:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1921 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 8b8a730..7fbb337 100644 (file)
@@ -38,9 +38,8 @@ mod_xmltools-install:
 webcore-install:
        @echo $@
        echo "Copying web into $(WEBDIR)"
-       # XXX put these back
-       #mkdir -p $(WEBDIR)
-       #cp -r ../web/* $(WEBDIR)
+       mkdir -p $(WEBDIR)
+       cp -r ../web/* $(WEBDIR)
 
 libfieldmapper:        
        make -C apachemods libfieldmapper.so
index a8e7fce..3d4ec42 100755 (executable)
@@ -99,6 +99,8 @@ function startOpenSRF {
 
 function makeMeGo {
        
+       i=$(whoami) && [ "$i" == "root" ] && echo "Cannot run as root.  Exiting..." && exit;
+       
        if [ ! -z "$JSERVER" ]; then
                echo "Starting Chop Chop, Jabber (jserver-c)...";
                startJserver;
index 65b7fd5..e3578d7 100755 (executable)
@@ -12,6 +12,8 @@ function usage {
 
 function startSystem {
 
+       i=$(whoami) && [ "$i" == "root" ] && echo "Cannot run as root.  Exiting..." && exit;
+
        case $1 in 
        
                "start")
index a057363..5a34a64 100755 (executable)
@@ -75,7 +75,13 @@ function mkInstallDirs {
                fi
        fi
 
-       
+
+       # add the opensrf user and group
+        if [ ! $(grep "^opensrf:" /etc/group) ]; then groupadd opensrf; fi
+        if [ ! $(grep "^opensrf:" /etc/passwd) ]; then useradd opensrf; fi
+
+        # add opensrf to the opensrf group
+        gpasswd -a opensrf opensrf
 
 }
 
@@ -217,6 +223,10 @@ function runInstall {
                esac
 
        done
+
+       if installing; then
+               echo -e "\nNow run: chown -R opensrf:opensrf $PREFIX"
+       fi
 }