From 8e866579cb459c5104c532d5e41d562d45236ea5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Jun 2015 19:20:16 +0200 Subject: Implement loader --- etc/apachectl | 5 +++++ etc/config | 12 ++++++++++-- etc/httpd.conf | 4 ++-- etc/loader | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100755 etc/loader (limited to 'etc') diff --git a/etc/apachectl b/etc/apachectl index 43e39ee..e282d9f 100755 --- a/etc/apachectl +++ b/etc/apachectl @@ -88,6 +88,11 @@ case $ARGV in ERROR=$? if test $ERROR -eq 0; then + $LYNX $STATUSURL 1>/dev/null 2>&1 + ERROR=$? + fi + + if test $ERROR -eq 0; then echo "server started" else echo "server starting failed" diff --git a/etc/config b/etc/config index ba428c5..15e6063 100644 --- a/etc/config +++ b/etc/config @@ -3,6 +3,7 @@ SCRIPT_DIR=`dirname $0` CONFIG_DIR=`cd $SCRIPT_DIR; pwd` PROJECT_DIR="$CONFIG_DIR/.." WORKSPACE_DIR="$PROJECT_DIR/var" +LIB_DIRS="$PROJECT_DIR/brep:$PROJECT_DIR/../libbutl/butl:$PROJECT_DIR/../libbpkg/bpkg" # PostgreSQL settings (used in pgctl) PG_PORT=8432 @@ -18,9 +19,16 @@ AP_ADMIN_EMAIL=admin@cppget.org AP_LOG_LEVEL=trace1 AP_DB_HOST="$PG_WORKSPACE_DIR" AP_DB_PORT=$PG_PORT -AP_LIB_DIRS="$PROJECT_DIR/../libbutl/butl:$PROJECT_DIR/../libbpkg/bpkg" -AP_MODULE_DIR="$PROJECT_DIR" +AP_LIB_DIRS="$LIB_DIRS" +AP_MODULE_DIR="$PROJECT_DIR/brep" AP_WWW_DIR="$PROJECT_DIR/www" AP_CONFIG_DIR="$CONFIG_DIR" AP_LOG_DIR="$WORKSPACE_DIR/log/httpd" AP_WORKSPACE_DIR="$WORKSPACE_DIR/run/httpd" + +# brep-loader settings (used in loader) +LD_DB_HOST="$PG_WORKSPACE_DIR" +LD_DB_PORT=$PG_PORT +LD_REPOSITORIES="$CONFIG_DIR/repositories.conf" +LD_LIB_DIRS="$LIB_DIRS" +LD_EXE_DIRS="$PROJECT_DIR/loader" diff --git a/etc/httpd.conf b/etc/httpd.conf index bf64517..71ac903 100644 --- a/etc/httpd.conf +++ b/etc/httpd.conf @@ -40,7 +40,7 @@ LoadModule authz_host_module /usr/lib64/httpd/modules/mod_authz_host.so LoadModule expires_module /usr/lib64/httpd/modules/mod_expires.so LoadModule dir_module /usr/lib64/httpd/modules/mod_dir.so -LoadModule search_srv ${AP_MODULE_DIR}/libbrep.so +LoadModule search_srv ${AP_MODULE_DIR}/libbrep-apache.so search-db-host ${AP_DB_HOST} @@ -48,7 +48,7 @@ LoadModule search_srv ${AP_MODULE_DIR}/libbrep.so search-conf "${AP_CONFIG_DIR}/search.conf" -LoadModule view_srv ${AP_MODULE_DIR}/libbrep.so +LoadModule view_srv ${AP_MODULE_DIR}/libbrep-apache.so view-db-host ${AP_DB_HOST} diff --git a/etc/loader b/etc/loader new file mode 100755 index 0000000..1ae3b48 --- /dev/null +++ b/etc/loader @@ -0,0 +1,18 @@ +#!/bin/sh +# file : etc/loader +# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file +# +# Designed to simplify running brep-loader utility. + +. `dirname $0`/config + +if test -n "$LD_LIB_DIRS"; then + export LD_LIBRARY_PATH=$LD_LIB_DIRS:$LD_LIBRARY_PATH +fi + +if test -n "$LD_EXE_DIRS"; then + export PATH=$LD_EXE_DIRS:$PATH +fi + +brep-loader --db-host "$LD_DB_HOST" --db-port $PG_PORT "$LD_REPOSITORIES" -- cgit v1.1