X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=etc%2Fsv%2Fopenerp7_burette%2Frun;fp=etc%2Fsv%2Fopenerp7_burette%2Frun;h=e45ce37d1ed751a0cc85d4450a4694f48c656c08;hp=0000000000000000000000000000000000000000;hb=c3a51f63171dfe81f25350f8a0251cf85a3a8de4;hpb=617ae234abe407638c2232da4a2d842a1c7583d6 diff --git a/etc/sv/openerp7_burette/run b/etc/sv/openerp7_burette/run new file mode 100755 index 0000000..e45ce37 --- /dev/null +++ b/etc/sv/openerp7_burette/run @@ -0,0 +1,54 @@ +#!/bin/sh -eux +exec 2>&1 +sv=${PWD#/etc/sv/} +home=/home/"$sv" +version=7.0 +cd / +export LOGNAME="$sv" + # NOTE: openerp utilise /tmp/oe-sessions-$LOGNAME + +for db in \ + cyclo_ivry \ + cyclo_pantin \ + cyclo_paris_est \ + dynamo \ + ptitvelo \ + velorution_idf \ + velosenville \ + vieuxbiclou + do + test -e /etc/openerp/"$version"/"${sv#openerp7_}"/"$db".ok || + /usr/bin/chpst \ + -u "$sv":"$sv":"$sv"-addon:postgres-data \ + /usr/bin/openerp-server \ + --addons-path="$home"/addon.d \ + --config /etc/openerp/"$version"/"${sv#openerp7_}"/server.conf \ + --database="${sv}_$db" \ + --db_host=/run/postgresql \ + --db_user="$sv" \ + --debug \ + --init=remembership,pos_membership,bikecoop \ + --load-language=fr_FR \ + --no-xmlrpcs \ + --osv-memory-age-limit=0.1 \ + --proxy-mode \ + --save \ + --stop-after-init \ + --timezone="$(cat /etc/timezone)" \ + --without-demo=base \ + --workers=0 \ + --xmlrpc-interface=127.0.0.1 \ + --xmlrpc-port=8069 + #--no-database-list \ + # NOTE: si --workers > 0 + # --limit-memory-hard=$((300 * 1024 * 1024)) + # --limit-memory-soft=$((150 * 1024 * 1024)) + touch /etc/openerp/"$version"/"${sv#openerp7_}"/"$db".ok + done + +exec /usr/bin/chpst \ + -u "$sv":"$sv":"$sv"-addon:postgres-data \ + /usr/bin/openerp-server \ + --config /etc/openerp/"$version"/"${sv#openerp7_}"/server.conf \ + --load-language=fr_FR \ + "$@"