gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 89/141: update configs and scripts


From: gnunet
Subject: [taler-grid5k] 89/141: update configs and scripts
Date: Thu, 18 Nov 2021 14:50:30 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit 0a77c625d8134bd5dfaaf551597fea7edd67102a
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Tue Nov 2 16:22:36 2021 +0100

    update configs and scripts
---
 configs/etc/nginx/sites-available/proxy            |  5 +-
 .../usr/lib/systemd/system/taler-wallet@.service   |  2 +-
 experiment/env                                     |  2 -
 experiment/run.sh                                  |  4 +-
 experiment/scripts/createusers.sh                  | 62 +++++++++++-----------
 experiment/scripts/database.sh                     |  8 +--
 6 files changed, 40 insertions(+), 43 deletions(-)

diff --git a/configs/etc/nginx/sites-available/proxy 
b/configs/etc/nginx/sites-available/proxy
index 399d745..5fb150e 100644
--- a/configs/etc/nginx/sites-available/proxy
+++ b/configs/etc/nginx/sites-available/proxy
@@ -6,9 +6,10 @@ upstream exchange {
   # <SERVERS_HERE>
 }
 
-log_format taler 'time=$time_local remote=$remote_addr request=$request 
status=$status '
+log_format taler 'time=$time_local remote=$remote_addr '
+                 'method=$request_method uri=$request_uri status=$status '
                  'upstream_connect_time=$upstream_connect_time '
-                'upstream_response_time=$upstream_response_time '
+                 'upstream_response_time=$upstream_response_time '
                  'request_time=$request_time';
 
 server {
diff --git a/configs/usr/lib/systemd/system/taler-wallet@.service 
b/configs/usr/lib/systemd/system/taler-wallet@.service
index 0055982..3b635c6 100755
--- a/configs/usr/lib/systemd/system/taler-wallet@.service
+++ b/configs/usr/lib/systemd/system/taler-wallet@.service
@@ -5,7 +5,7 @@ StartLimitIntervalSec=0
 [Service]
 Type=simple
 Restart=always
-RestartSec=1
+RestartSec=2
 EnvironmentFile=/etc/environment
 ExecStart=/root/scripts/test1.sh %I
 
diff --git a/experiment/env b/experiment/env
index 773450a..28f8293 100755
--- a/experiment/env
+++ b/experiment/env
@@ -38,8 +38,6 @@ NUM_WALLET_HOSTS=3
 NUM_WALLET_PROCESSES=10
 
 # Number of exchange processes to run
-# This number is incremented by one
-# i.e. specifying 0 will result in 1 process
 NUM_EXCHANGE_PROCESSES=1
 
 # If prometheus node exporter should be enabled
diff --git a/experiment/run.sh b/experiment/run.sh
index cef4b93..8f7683a 100644
--- a/experiment/run.sh
+++ b/experiment/run.sh
@@ -69,9 +69,9 @@ case "${HOSTNAME}" in
     ;;
   ${WALLET_HOSTS}) 
     set_host wallet
-    # sleep a random amount in 1 to 20 seconds
+    # sleep a random amount from 0 to 10 seconds 
     # so every wallet has enough time and no entry is duplicated
-    sleep $[ ( $RANDOM % 20 )  + 1 ]s
+    sleep $((RANDOM % 10)).$((RANDOM))
     for (( i = 0; i < ${NUM_WALLET_HOSTS}; ++i )) 
     do 
       if ! nslookup "wallet-${i}.${DNS_ZONE}"; 
diff --git a/experiment/scripts/createusers.sh 
b/experiment/scripts/createusers.sh
index a573c1a..535f198 100755
--- a/experiment/scripts/createusers.sh
+++ b/experiment/scripts/createusers.sh
@@ -5,50 +5,48 @@ set -e
 . /usr/share/debconf/confmodule
 
 TALER_HOME="/var/lib/taler"
-_GROUPNAME=taler-exchange-secmod
-_DBGROUPNAME=taler-exchange-db
-_EUSERNAME=taler-exchange-httpd
-_CLOSERUSERNAME=taler-exchange-closer
-_RSECUSERNAME=taler-exchange-secmod-rsa
-_ESECUSERNAME=taler-exchange-secmod-eddsa
-_AGGRUSERNAME=taler-exchange-aggregator
-_WIREUSERNAME=taler-exchange-wire
-
-TALER_HOME="/var/lib/taler"
+GROUPNAME=taler-exchange-secmod
+DBGROUPNAME=taler-exchange-db
+EUSERNAME=taler-exchange-httpd
+CLOSERUSERNAME=taler-exchange-closer
+RSECUSERNAME=taler-exchange-secmod-rsa
+ESECUSERNAME=taler-exchange-secmod-eddsa
+AGGRUSERNAME=taler-exchange-aggregator
+WIREUSERNAME=taler-exchange-wire
 
 # Create taler groups as needed
-if ! getent group ${_GROUPNAME} >/dev/null; then
-  addgroup --quiet --system ${_GROUPNAME}
+if ! getent group ${GROUPNAME} >/dev/null; then
+  addgroup --quiet --system ${GROUPNAME}
 fi
-if ! getent group ${_DBGROUPNAME} >/dev/null; then
-  addgroup --quiet --system ${_DBGROUPNAME}
+if ! getent group ${DBGROUPNAME} >/dev/null; then
+  addgroup --quiet --system ${DBGROUPNAME}
 fi
 if ! getent group taler-exchange-offline >/dev/null; then
   addgroup --quiet --system taler-exchange-offline
 fi
 
 # Create taler users if needed
-if ! getent passwd ${_EUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home 
${TALER_HOME} ${_EUSERNAME}
-  adduser --quiet ${_EUSERNAME} ${_DBGROUPNAME}
+if ! getent passwd ${EUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --ingroup ${GROUPNAME} --home 
${TALER_HOME} ${EUSERNAME}
+  adduser --quiet ${EUSERNAME} ${DBGROUPNAME}
 fi
-if ! getent passwd ${_RSECUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home 
${TALER_HOME} ${_RSECUSERNAME}
+if ! getent passwd ${RSECUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --ingroup ${GROUPNAME} --home 
${TALER_HOME} ${RSECUSERNAME}
 fi
-if ! getent passwd ${_ESECUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home 
${TALER_HOME} ${_ESECUSERNAME}
+if ! getent passwd ${ESECUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --ingroup ${GROUPNAME} --home 
${TALER_HOME} ${ESECUSERNAME}
 fi
-if ! getent passwd ${_WIREUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${_WIREUSERNAME}
-  adduser --quiet ${_WIREUSERNAME} ${_DBGROUPNAME}
+if ! getent passwd ${WIREUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${WIREUSERNAME}
+  adduser --quiet ${WIREUSERNAME} ${DBGROUPNAME}
 fi
-if ! getent passwd ${_CLOSERUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${_CLOSERUSERNAME}
-  adduser --quiet ${_CLOSERUSERNAME} ${_DBGROUPNAME}
+if ! getent passwd ${CLOSERUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${CLOSERUSERNAME}
+  adduser --quiet ${CLOSERUSERNAME} ${DBGROUPNAME}
 fi
-if ! getent passwd ${_AGGRUSERNAME} >/dev/null; then
-  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${_AGGRUSERNAME}
-  adduser --quiet ${_AGGRUSERNAME} ${_DBGROUPNAME}
+if ! getent passwd ${AGGRUSERNAME} >/dev/null; then
+  adduser --quiet --system --no-create-home --home ${TALER_HOME} 
${AGGRUSERNAME}
+  adduser --quiet ${AGGRUSERNAME} ${DBGROUPNAME}
 fi
 if ! getent passwd taler-exchange-offline >/dev/null; then
   adduser --quiet --system \
@@ -67,13 +65,13 @@ install -d /var/lib/taler/exchange-secmod-eddsa -m 0700 -o 
taler-exchange-secmod
 
 if ! dpkg-statoverride --list 
/etc/taler/secrets/exchange-accountcredentials.secret.conf >/dev/null 2>&1; then
   dpkg-statoverride --add --update \
-    ${_WIREUSERNAME} root 460 \
+    ${WIREUSERNAME} root 460 \
     /etc/taler/secrets/exchange-accountcredentials.secret.conf
 fi
 
 if ! dpkg-statoverride --list /etc/taler/secrets/exchange-db.secret.conf 
>/dev/null 2>&1; then
   dpkg-statoverride --add --update \
-    root ${_DBGROUPNAME} 660 \
+    root ${DBGROUPNAME} 660 \
     /etc/taler/secrets/exchange-db.secret.conf
 fi
 
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 1668c39..da0fb17 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -38,12 +38,12 @@ EOF
 sudo -u taler-exchange-httpd taler-exchange-dbinit
 
 su postgres << EOF
-psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='USR_NAME'" | \
+psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='${DB_USER}'" | \
   grep -q 1 \
   || psql << END
-    CREATE USER "${DB_USER}" with encrypted password '${DB_PASSWORD}';
-    CREATE EXTENSION pg_stat_statements;
-    END
+     CREATE USER "${DB_USER}" with encrypted password '${DB_PASSWORD}';
+     CREATE EXTENSION pg_stat_statements;
+END
 EOF
 
 su taler-exchange-httpd -s /bin/bash << EOF

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]