diff --git a/Installation/arango.conf b/Installation/arango.conf index 9b24043d01..b10a06aec6 100644 --- a/Installation/arango.conf +++ b/Installation/arango.conf @@ -1,11 +1,22 @@ [server] http-port = localhost:8529 admin-port = localhost:8530 +admin-directory= @STATICFILES@/html/admin [action] +system-directory= @STATICFILES@/js/actions/system threads = 4 [log] level = info severity = human -file = /var/log/voc/arango.log +file = @LOGDIR@/arango.log + +[database] +directory= @DATABASE@ +# maximal-journal-size=33554432 +# remove-on-drop=true + +[startup] +# directory = +modules-path = @STATICFILES@/js/server/modules;@STATICFILES@/js/common/modules diff --git a/Installation/arangodb.list b/Installation/arangodb.list index 6e583a429c..1e2096364a 100644 --- a/Installation/arangodb.list +++ b/Installation/arangodb.list @@ -23,25 +23,30 @@ $release=${arangodb_release} ## File List ################################################################################ -d 0755 ${susr} ${sgrp} /etc/voc - -d 0755 ${susr} ${sgrp} /etc/voc/${vers_dir} - -f 0644 ${susr} ${sgrp} /etc/voc/${vers_dir}/arango.conf.template ${project_dir}/Installation/arango.conf +d 0755 ${susr} ${sgrp} /etc/arangodb - +d 0755 ${susr} ${sgrp} /etc/arangodb/${vers_dir} - +f 0644 ${susr} ${sgrp} /etc/arangodb/${vers_dir}/arango.conf.template ${project_dir}/Installation/arango.conf f 0755 ${susr} ${sgrp} ${bindir}/arangod-${arangodb_version} ${project_dir}/arangod +l 000 ${rusr} ${rgrp} ${bindir}/arangod ${bindir}/arangod-${arangodb_version} -d 0755 ${rusr} ${rgrp} ${datadir}/voc - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir} - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir}/js - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir}/js/modules - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir}/js/system - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir}/html - -d 0755 ${susr} ${sgrp} ${datadir}/voc/${vers_dir}/html/admin - +# database directory +d 0755 ${rusr} ${rgrp} ${data_dir} - +d 0755 ${susr} ${sgrp} ${data_dir}/arango - -d 0755 ${susr} ${sgrp} /var/lib/arango - -d 0755 ${rusr} ${rgrp} /var/run/voc - -d 0755 ${susr} ${sgrp} /var/run/voc/${vers_dir}/ - -d 0755 ${rusr} ${rgrp} /var/log/voc - -d 0755 ${susr} ${sgrp} /var/log/voc/${vers_dir}/ - +# static files +d 0755 ${susr} ${sgrp} ${static_dir} - +d 0755 ${susr} ${sgrp} ${static_dir}/js - +d 0755 ${susr} ${sgrp} ${static_dir}/html - + +# ???? +# d 0755 ${susr} ${sgrp} /var/lib/arango - + +# PID file directory +d 0755 ${susr} ${sgrp} /var/run/arangod - + +# logfile directory +d 0755 ${rusr} ${rgrp} /var/log/arangodb - %include ${project_dir}/Installation/arangodb.sublist @@ -50,14 +55,14 @@ d 0755 ${susr} ${sgrp} /var/log/voc/${vers_dir}/ - ################################################################################ %postinstall < /etc/voc/${vers_dir}/arango.conf +sed -e 's%@LOGDIR@%/var/log/arangodb%g' -e 's%@DATABASE@%${data_dir}/arango%g' -e 's%@STATICFILES@%${static_dir}/arango%g' /etc/arangodb/${vers_dir}/arango.conf.template > /etc/arango.conf EOF %ifdef macosx d 0755 ${rusr} ${rgrp} /Library/LaunchDaemons/ - -f 0755 ${rusr} ${rgrp} /Library/LaunchDaemons/de.triagens.arango.plist.template ${project_dir}/Installation/MacOSX/MacPorts/org.arangodb.plist +f 0755 ${rusr} ${rgrp} /Library/LaunchDaemons/de.triagens.arango.plist.template ${project_dir}/Installation/org.arangodb.plist %postinstall < /Library/LaunchDaemons/de.triagens.arango.plist +sed -e 's%@BINARY@%${bindir}/arango-${version}%g' -e 's%@CONFIGDIR@%/etc%g' /Library/LaunchDaemons/de.triagens.arango.plist.template > /Library/LaunchDaemons/de.triagens.arango.plist launchctl unload /Library/LaunchDaemons/de.triagens.arango.plist launchctl load /Library/LaunchDaemons/de.triagens.arango.plist launchctl start de.triagens.arango @@ -71,7 +76,7 @@ EOF %else %preinstall </dev/null || groupadd -r arango -getent passwd arango >/dev/null || useradd -r -g arango -d /usr/share/arango -s /bin/false -c "ArangoDB Application User" arango +getent passwd arango >/dev/null || useradd -r -g arango -d ${static_dir} -s /bin/false -c "ArangoDB Application User" arango EOF %endif @@ -90,4 +95,4 @@ EOF %system linux i 0755 ${rusr} ${rgrp} arango ${project_dir}/Installation/${START_SCRIPT} ${runlevels} -# l 000 ${rusr} ${rgrp} ${bindir}/rcarango /etc/init.d/arango +l 000 ${rusr} ${rgrp} ${bindir}/rcarango /etc/init.d/arango diff --git a/Installation/org.arangodb.plist b/Installation/org.arangodb.plist new file mode 100644 index 0000000000..f8ed8309b3 --- /dev/null +++ b/Installation/org.arangodb.plist @@ -0,0 +1,27 @@ + + + + + Disabled + + + Label + org.arangodb + + ProgramArguments + + @BINARY@ + -c + @CONFIGDIR@/arango.conf + + + UserName + arango + + GroupName + arango + + RunAtLoad + + + diff --git a/Installation/rc.arangodb.OpenSuSE b/Installation/rc.arangodb.OpenSuSE index e69de29bb2..d7e6c8ce5e 100644 --- a/Installation/rc.arangodb.OpenSuSE +++ b/Installation/rc.arangodb.OpenSuSE @@ -0,0 +1,145 @@ +#! /bin/sh +# Copyright (c) 2011-2012 triAGENS GmbH Cologne, Germany. +# +# Author: Achim Brandt +# +# /etc/init.d/arango +# +# and symbolic its link +# +# /usr/sbin/rcarango +# +### BEGIN INIT INFO +# Provides: arangod +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Description: Start the session voc daemon +### END INIT INFO + +ARANGO_BIN=/usr/sbin/arangod +test -x $ARANGO_BIN || exit 5 + +ARANGO_SYSCONFIG=/etc/arango.conf +test -r $ARANGO_SYSCONFIG || exit 6 + + +ARANGO_PIDFILE=/var/run/arangod/pid + +. /etc/rc.status + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_failed set local and overall rc status to failed +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status + +# First reset status of this service +rc_reset + +case "$1" in + + ################################################################################ + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + ################################################################################ + + start) + echo -n "Starting ARANGO daemon" + + $ARANGO_BIN -c $ARANGO_SYSCONFIG --pid-file "$ARANGO_PIDFILE" --supervisor --uid arango + + # Remember status and be verbose + rc_status -v + ;; + + ################################################################################ + ## Stop daemon with killproc(8) and if this fails + ## set echo the echo return value. + ################################################################################ + + stop) + echo -n "Shutting down ARANGO daemon" + + killproc -p $ARANGO_PIDFILE -TERM $ARANGO_BIN + + # Remember status and be verbose + rc_status -v + ;; + + ################################################################################ + ## Stop the service and if this succeeds (i.e. the + ## service was running before), start it again. + ################################################################################ + + try-restart) + $0 status >/dev/null && $0 restart + + # Remember status and be quiet + rc_status + + ;; + + ################################################################################ + ## Stop the service and regardless of whether it was + ## running or not, start it again. + ################################################################################ + + restart) + $0 stop + $0 start + + # Remember status and be quiet + rc_status + ;; + + ################################################################################ + ## Signal the daemon to reload its config. Most daemons + ## do this on signal 1 (SIGHUP). + ################################################################################ + + force-reload|reload) + echo -n "Reload service ARANGO" + + echo "reload is currently not supported" + + rc_status -v + + ;; + + ################################################################################ + ## Check status with checkproc(8), if process is running + ## checkproc will return with exit status 0. + ## Status has a slightly different for the status command: + ## + ## 0 - service running + ## 1 - service dead, but /var/run/ pid file exists + ## 2 - service dead, but /var/lock/ lock file exists + ## 3 - service not running + ################################################################################ + + status) + echo -n "Checking for service ARANGO " + + checkproc -p $ARANGO_PIDFILE $ARANGO_BIN + + rc_status -v + + ;; + + ################################################################################ + ## print usage message + ################################################################################ + + *) + echo "Usage: $0 {start|stop|status|try-restart|restart}" + exit 1 + + ;; +esac + +rc_exit diff --git a/packetize.sh b/packetize.sh index d555015904..4156207931 100755 --- a/packetize.sh +++ b/packetize.sh @@ -15,8 +15,14 @@ sgrp=arango package_type="" product_name="arangodb" project_name="arangodb" +runlevels="runlevel(035)" + + +# name of the epm configuration file LIST="Installation/${project_name}.list" +# name of a created epm include file SUBLIST="Installation/${project_name}.sublist" + START_SCRIPT=""; arangodb_version=`cat VERSION | awk -F"." '{print $1 "." $2}'` @@ -29,9 +35,9 @@ osvers=`uname -r | awk -F"." '{print $1 "." $2}'` prefix=/usr exec_prefix=${prefix} bindir=${exec_prefix}/sbin -datadir=${prefix}/share +data_dir=${prefix}/var +static_dir=${prefix}/share vers_dir=arango-${arangodb_version} -runlevels="runlevel(035)" docdir=${prefix}/share/doc/voc/${vers_dir} @@ -144,20 +150,20 @@ export EPM_RPM_OPTION test -f ${SUBLIST} && rm -f ${SUBLIST} touch ${SUBLIST} -share_base=/usr/share/voc/arangodb-${arangodb_version} +share_base=${static_dir}/arango sfolder_name=$(pwd) echo echo "########################################################" echo "Call mkepmlist to create a sublist" - for dir in modules modules/jsunity system; do - echo " mkepmlist -u ${susr} -g ${sgrp} --prefix ${share_base}/js ${sfolder_name}/js/${dir}/*.js >> ${SUBLIST}" - mkepmlist -u ${susr} -g ${sgrp} --prefix ${share_base}/js ${sfolder_name}/js/${dir}/*.js > ${SUBLIST} + for dir in js/server/modules js/common/modules js/actions/system js/client js/common/bootstrap; do + echo " mkepmlist -u ${susr} -g ${sgrp} --prefix ${share_base}/${dir} ${sfolder_name}/${dir}/*.js >> ${SUBLIST}" + mkepmlist -u ${susr} -g ${sgrp} --prefix ${share_base}/${dir} ${sfolder_name}/${dir}/*.js >> ${SUBLIST} done echo "Call mkepmlist to create a sublist" - for dir in . css css/images images script; do + for dir in . css css/images media media/icons media/images js js/modules; do for typ in css html js png gif ico; do FILES=${sfolder_name}/html/admin/${dir}/*.${typ} @@ -189,7 +195,8 @@ echo " export sgrp=$sgrp" echo " export prefix=$prefix" echo " export exec_prefix=$exec_prefix" echo " export bindir=$bindir" -echo " export datadir=$datadir" +echo " export data_dir=$data_dir" +echo " export static_dir=$static_dir" echo " export vers_dir=$vers_dir" echo " export START_SCRIPT=$START_SCRIPT" echo " export runlevels=$runlevels" @@ -207,7 +214,8 @@ export sgrp export prefix export exec_prefix export bindir -export datadir +export data_dir +export static_dir export vers_dir export START_SCRIPT export runlevels