From a018104e0bdde6312277472d19bd2c68971a5e8c Mon Sep 17 00:00:00 2001 From: janskiba Date: Wed, 5 Jun 2024 12:35:44 +0000 Subject: [PATCH 1/2] feat: Add logs command for journalctl and rename old one to docker-logs --- README.md | 7 ++++--- bridgehead | 5 +++++ lib/functions.sh | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 05038ae..d95a3b0 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ sudo systemctl [enable|disable] bridgehead@.service After starting the Bridgehead, you can watch the initialization process with the following command: ```shell -journalctl -u bridgehead@bbmri -f +./bridghead logs -f ``` if this exits with something similar to the following: @@ -220,8 +220,9 @@ docker ps There should be 6 - 10 Docker proceses. If there are fewer, then you know that something has gone wrong. To see what is going on, run: ```shell -journalctl -u bridgehead@bbmri -f +./bridghead logs -f ``` +This translates to a journalctl command so all the regular journalctl flags can be used. Once the Bridgehead has passed these checks, take a look at the landing page: @@ -235,7 +236,7 @@ You can either do this in a browser or with curl. If you visit the URL in the br curl -k https://localhost ``` -If you get errors when you do this, you need to use ```docker logs``` to examine your landing page container in order to determine what is going wrong. +If you get errors when you do this, you can inspect the logs of your landing page container in order to determine what is going wrong. To do this you can use `./bridgehead docker-logs landing -f` to follow the logs of the container. This transaltes to a docker compose logs command meaning all the ususal docker logs flags work. If you have chosen to take part in our monitoring program (by setting the ```MONITOR_APIKEY``` variable in the configuration), you will be informed by email when problems are detected in your Bridgehead. diff --git a/bridgehead b/bridgehead index bde1e16..85593b0 100755 --- a/bridgehead +++ b/bridgehead @@ -107,6 +107,11 @@ case "$ACTION" in exit $? ;; logs) + loadVars + shift 2 + exec journalctl -u bridgehead@$PROJECT -u bridgehead-update@$PROJECT -a $@ + ;; + docker-logs) loadVars shift 2 exec $COMPOSE -p $PROJECT -f ./minimal/docker-compose.yml -f ./$PROJECT/docker-compose.yml $OVERRIDE logs -f $@ diff --git a/lib/functions.sh b/lib/functions.sh index b519369..5e69a04 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -53,7 +53,7 @@ checkOwner(){ } printUsage() { - echo "Usage: bridgehead start|stop|logs|is-running|update|install|uninstall|adduser|enroll PROJECTNAME" + echo "Usage: bridgehead start|stop|logs|docker-logs|is-running|update|install|uninstall|adduser|enroll PROJECTNAME" echo "PROJECTNAME should be one of ccp|bbmri" } From ec9df1feec212bd00e806083124cb2f4b6208955 Mon Sep 17 00:00:00 2001 From: Jan <59206115+Threated@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:57:42 +0200 Subject: [PATCH 2/2] Update README.md Co-authored-by: patrickskowronekdkfz <86347677+patrickskowronekdkfz@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d95a3b0..bb332e4 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ You can either do this in a browser or with curl. If you visit the URL in the br curl -k https://localhost ``` -If you get errors when you do this, you can inspect the logs of your landing page container in order to determine what is going wrong. To do this you can use `./bridgehead docker-logs landing -f` to follow the logs of the container. This transaltes to a docker compose logs command meaning all the ususal docker logs flags work. +Should the landing page not show anything, you can inspect the logs of the containers to determine what is going wrong. To do this you can use `./bridgehead docker-logs -f` to follow the logs of the container. This transaltes to a docker compose logs command meaning all the ususal docker logs flags work. If you have chosen to take part in our monitoring program (by setting the ```MONITOR_APIKEY``` variable in the configuration), you will be informed by email when problems are detected in your Bridgehead.