From 02891cf320ef7a7d65018257695fcb3cb12b5187 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Sun, 11 Sep 2022 15:19:52 +0000 Subject: [PATCH] chore(bbb-web): do away with wrapper script, use default files --- bigbluebutton-web/README.md | 7 +++---- bigbluebutton-web/run-prod.sh | 2 -- build/packages-template/bbb-web/bbb-web.env | 6 ++++++ build/packages-template/bbb-web/bbb-web.service | 4 ++-- build/packages-template/bbb-web/build.sh | 4 +++- 5 files changed, 14 insertions(+), 9 deletions(-) delete mode 100755 bigbluebutton-web/run-prod.sh create mode 100644 build/packages-template/bbb-web/bbb-web.env diff --git a/bigbluebutton-web/README.md b/bigbluebutton-web/README.md index a5353d9ee1..48964bd6a7 100644 --- a/bigbluebutton-web/README.md +++ b/bigbluebutton-web/README.md @@ -62,8 +62,7 @@ To package the application for production: 3. Create a new directory `mkdir exploded` 4. Navigate to that directory `cd exploded` 5. Extract the war content `jar -xvf ../build/libs/bigbluebutton-0.10.0.war` -6. Copy run script into exploded dir `cp ../run-prod.sh .` -7. Package the content of the new directory in a debian package then add service configuration. Install into `/usr/share/bbb-web`. -8. Create a systemd service file that runs `run-prod.sh`. App will be listening on port 8080 -9. To do custom config, edit `/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties` +6. Package the content of the new directory in a debian package then add service configuration. Install into `/usr/share/bbb-web`. +7. Use the systemd service file provided in build/package-template/bbb-web. App will be listening on port 8080 +8. To do custom config, edit `/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties` Don't forget to use full directories path and replace the dot before the org with the full path to the exploded war. diff --git a/bigbluebutton-web/run-prod.sh b/bigbluebutton-web/run-prod.sh deleted file mode 100755 index 41a595ab1d..0000000000 --- a/bigbluebutton-web/run-prod.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec java -Dgrails.env=prod -Dserver.address=127.0.0.1 -Dserver.port=8090 -Dspring.main.allow-circular-references=true -Xms384m -Xmx384m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/bigbluebutton/diagnostics -cp WEB-INF/lib/*:/:WEB-INF/classes/:. org.springframework.boot.loader.WarLauncher diff --git a/build/packages-template/bbb-web/bbb-web.env b/build/packages-template/bbb-web/bbb-web.env new file mode 100644 index 0000000000..1df9a9bb36 --- /dev/null +++ b/build/packages-template/bbb-web/bbb-web.env @@ -0,0 +1,6 @@ +ENV=prod +LISTEN_ADDRESS=127.0.0.1 +LISTEN_PORT=8090 +INITIAL_HEAP_SIZE=384m +MAX_HEAP_SIZE=384m +HEAP_DUMP_PATH=/var/bigbluebutton/diagnostics diff --git a/build/packages-template/bbb-web/bbb-web.service b/build/packages-template/bbb-web/bbb-web.service index b3c5f7459f..4d545eeb03 100644 --- a/build/packages-template/bbb-web/bbb-web.service +++ b/build/packages-template/bbb-web/bbb-web.service @@ -10,9 +10,9 @@ Type=simple User=bigbluebutton Group=bigbluebutton WorkingDirectory=/usr/share/bbb-web -#EnvironmentFile=/etc/default/bbb-web +EnvironmentFile=/etc/default/bbb-web #ExecStartPre=/bin/chown -R bigbluebutton:bigbluebutton /usr/share/bbb-web -ExecStart=/usr/share/bbb-web/run-prod.sh +ExecStart=java -Dgrails.env=${ENV} -Dserver.address=${LISTEN_ADDRESS} -Dserver.port=${LISTEN_PORT} -Dspring.main.allow-circular-references=true -Xms${INITIAL_HEAP_SIZE} -Xmx${MAX_HEAP_SIZE} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${HEAP_DUMP_PATH} -cp WEB-INF/lib/*:/:WEB-INF/classes/:. org.springframework.boot.loader.WarLauncher ExecReload=/bin/kill -HUP $MAINPID Restart=always RestartSec=60 diff --git a/build/packages-template/bbb-web/build.sh b/build/packages-template/bbb-web/build.sh index d597a7044b..57b776fb9b 100755 --- a/build/packages-template/bbb-web/build.sh +++ b/build/packages-template/bbb-web/build.sh @@ -79,7 +79,9 @@ echo $PWD mkdir -p "$STAGING"/usr/share/bbb-web mv build/libs/bigbluebutton-0.10.0.war "$STAGING"/usr/share/bbb-web -cp run-prod.sh "$STAGING"/usr/share/bbb-web + +mkdir -p "$STAGING"/etc/default +cp ../bbb-web.env "$STAGING"/etc/default/bbb-web mkdir -p "$STAGING"/lib/systemd/system cp ../bbb-web.service "$STAGING"/lib/systemd/system