gnunet-svn
[Top][All Lists]
Advanced

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

[taler-grid5k] 60/73: fix logbackup so it gets rotated correctly


From: gnunet
Subject: [taler-grid5k] 60/73: fix logbackup so it gets rotated correctly
Date: Tue, 14 Dec 2021 15:10:42 +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 feb7d12ca4000e34674b3655f2bfef0c0c197216
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Fri Dec 10 18:37:19 2021 +0100

    fix logbackup so it gets rotated correctly
---
 experiment/scripts/helpers.sh | 12 ++++++++++++
 experiment/scripts/run.sh     | 12 ++++++++++++
 experiment/scripts/setup.sh   | 12 ++----------
 notes.txt                     |  4 ----
 4 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/experiment/scripts/helpers.sh b/experiment/scripts/helpers.sh
index 5557a5c..0f0b19e 100755
--- a/experiment/scripts/helpers.sh
+++ b/experiment/scripts/helpers.sh
@@ -37,6 +37,18 @@ function enable_netdelay() {
   systemctl restart taler-netdelay.timer
 }
 
+function setup_log() {
+  HOST_LOG_DIR=${LOG_DIR}/${TALER_HOST}
+  test -d ${HOST_LOG_DIR} || mkdir ${HOST_LOG_DIR} 
+  # Send all logs about taler to promtail on the monitoring node
+  sed -i -e "s/<MONITOR_DOMAIN_HERE>/${MONITOR_DOMAIN}/g" \
+         -e "s|<LOG_DIR_HERE>|${HOST_LOG_DIR}|g" \
+       /etc/rsyslog.d/taler.conf
+  
+  sed -i "s|<LOG_DIR_HERE>|${HOST_LOG_DIR}|g" \
+          /etc/logrotate.d/taler
+}
+
 function enable_logbackup() {
   systemctl restart taler-logbackup.timer
 }
diff --git a/experiment/scripts/run.sh b/experiment/scripts/run.sh
index 8d4def7..48e2a11 100644
--- a/experiment/scripts/run.sh
+++ b/experiment/scripts/run.sh
@@ -13,16 +13,21 @@ case "${HOSTNAME}" in
   ${BANK_HOSTS}) 
     set_host bank
     set_ddn ${BANK_DOMAIN}
+    setup_log
+    enable_logbackup
     exec ~/scripts/bank.sh
     ;;
   ${DB_HOSTS}) 
     set_host database
     set_ddn ${DATABASE_DOMAIN}
+    setup_log
+    enable_logbackup
     exec ~/scripts/database.sh init
     ;;
   ${EXCHANGE_HOSTS}) 
     set_host exchange
     set_ddn ${EXCHANGE_DOMAIN}
+    setup_log
     enable_logbackup
     enable_netdelay ${DATABASE_DOMAIN}
     exec ~/scripts/exchange.sh init
@@ -30,6 +35,8 @@ case "${HOSTNAME}" in
   ${MERCHANT_HOSTS})
     set_host merchant
     set_ddn ${MERCHANT_DOMAIN}
+    setup_log
+    enable_logbackup
     exec ~/scripts/merchant.sh init
     ;;
   ${MONITOR_HOSTS})
@@ -41,15 +48,20 @@ case "${HOSTNAME}" in
     set_host proxy
     set_ddn ${PROXY_DOMAIN}
     enable_netdelay ${EXCHANGE_DOMAIN}
+    setup_log
+    enable_logbackup
     exec ~/scripts/proxy.sh init
     ;;
   ${DNS_HOSTS})
+    set_host dns
+    setup_log
     ;;
   ${WALLET_HOSTS}) 
     set_host wallet
     HOST=$(hostname | cut -d '.' -f1)
     set_ddn "${WALLET_DOMAIN//\*/${HOST}}"
     enable_netdelay ${PROXY_DOMAIN}
+    setup_log
     exec ~/scripts/wallet.sh init
     ;;
 esac
diff --git a/experiment/scripts/setup.sh b/experiment/scripts/setup.sh
index 3a9735d..da8fafa 100644
--- a/experiment/scripts/setup.sh
+++ b/experiment/scripts/setup.sh
@@ -27,7 +27,7 @@ function parse_experiment_nodes() {
   echo "WALLET_HOSTS=*" >> ~/.env
 }
 
-function setup_log() {
+function setup_log_dir() {
   LOG_DIR=/home/${G5K_USER}/taler-logs
   
   if [ -d ${LOG_DIR} ]; then
@@ -73,14 +73,6 @@ function setup_config() {
   # Override default configurations with the one from this Git.
   cp -r "${G5K_HOME}"/configs/* /
   
-  # Send all logs about taler to promtail on the monitoring node
-  sed -i -e "s/<MONITOR_DOMAIN_HERE>/${MONITOR_DOMAIN}/g" \
-         -e "s|<LOG_DIR_HERE>|${LOG_DIR}|g" \
-       /etc/rsyslog.d/taler.conf
-  
-  sed -i "s|<LOG_DIR_HERE>|${LOG_DIR}|g" \
-          /etc/logrotate.d/taler
-  
   find /usr/lib/systemd/system/ -iname taler-exchange-httpd*.service \
        -exec sed -i "s|<CMD_PREFIX_HERE>|${EXCHANGE_CMD_PREFIX} |g" {} \;
   
@@ -129,7 +121,7 @@ function setup_dns() {
 }
 
 parse_experiment_nodes
-setup_log
+setup_log_dir
 setup_environment
 setup_config
 setup_dns
diff --git a/notes.txt b/notes.txt
index cbad953..4907eab 100644
--- a/notes.txt
+++ b/notes.txt
@@ -18,11 +18,7 @@
     The proxy server could not handle the request<p>Reason: <strong>Error 
reading from remote server</strong></p></p>
 * SSH login from rpesc viewer not possible
 * SSH login often fails - must provide password for cert and user (user 
password is not the one I speciefied, neither the default for the root user of 
the image) - or connection closed ... - BUG in allocation code according to 
email
-* espec documentation incomplete and contains unknown key, exaple: 
execute.local dir.sudo .config
-* espec dir creation does not work - hangs at Dir "null" Creations at ...
 * espec - possibility to rerun and override previously uploaded files 
(directory type) or at leat a pre-upload execute step to clean manually
-* espec - states 'permissions' as keyword where it is really 'permission' only
-* ansible not working with debian 11 - install script fails - but even when 
installed manually it hangs in preparing ansible dir
 * Maybe add a grouping option, so multi command can be run on a group rather 
than manually selecting the matching nodes
 * Espec should have the permission to scp or ssh - auth forwarding?
 * jFed don't abort when e.g.

-- 
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]