From e72527ab9d9169a9c953a1e41c3bb143913aea7c Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 24 Oct 2005 18:19:05 +0000 Subject: [PATCH] forcing user opensrf to start the system 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 | 2 +- OpenSRF/bin/opensrf_all | 2 +- OpenSRF/bin/opensrf_ctl | 2 +- OpenSRF/src/Makefile | 2 +- config.sh | 2 ++ install.sh | 22 ++++++++++++++++++++++ 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 7fbb33720a..8fd5e603e4 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -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/" diff --git a/OpenSRF/bin/opensrf_all b/OpenSRF/bin/opensrf_all index 3d4ec42346..c337284052 100755 --- a/OpenSRF/bin/opensrf_all +++ b/OpenSRF/bin/opensrf_all @@ -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)..."; diff --git a/OpenSRF/bin/opensrf_ctl b/OpenSRF/bin/opensrf_ctl index e3578d73d5..98502779aa 100755 --- a/OpenSRF/bin/opensrf_ctl +++ b/OpenSRF/bin/opensrf_ctl @@ -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 diff --git a/OpenSRF/src/Makefile b/OpenSRF/src/Makefile index 66583182a3..47c86a9b87 100644 --- a/OpenSRF/src/Makefile +++ b/OpenSRF/src/Makefile @@ -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 diff --git a/config.sh b/config.sh index 4e5b6b468d..78be831221 100755 --- 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\""; diff --git a/install.sh b/install.sh index 5a34a64a92..11b039843c 100755 --- a/install.sh +++ b/install.sh @@ -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 -- 2.43.2