From 12b2485b7a60f881fba6ffba48e3b296eaa51930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 8 Jan 2023 16:23:37 +0100 Subject: [PATCH 1/3] add docs how to create a systemd unit for babelweb2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Küthe --- docs/routing/babeld/babelweb2.md | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/routing/babeld/babelweb2.md b/docs/routing/babeld/babelweb2.md index f00d58e..e4748db 100644 --- a/docs/routing/babeld/babelweb2.md +++ b/docs/routing/babeld/babelweb2.md @@ -21,3 +21,44 @@ Now you have an executable program `babelweb2`. By default, the web interface runs on port 8080. You can also specify a different endpoint with the `-http` parameter. babelweb2 uses the local configuration interface of babeld. This must have been activated beforehand. babeld assumes that this is active on `[::1]:33123`. Alternatively, you can specify the endpoint with the `-node=` flag. + + +## Install as Systemd Unit + +In order to install babelweb2 as a systemd unit, we must first install the necessary files into the system. For this we can execute the following commands in the babelweb2 git directory: +``` +sudo cp babelweb2 /usr/local/bin +sudo mkdir -p /usr/share/babelweb2/ +sudo cp -r ./static/ /usr/share/babelweb2/ +``` + +After that we create the unit file `/etc/systemd/system/babelweb2.service`: +``` +[Unit] +Description=Yet Another Monitoring Tool for the Babel routing daemon +Documentation=https://github.com/Vivena/babelweb2 + +[Service] +LimitNOFILE=1048576 +LimitNPROC=512 +User=nobody +EnvironmentFile=/etc/default/babelweb2 +ExecStart=/usr/local/bin/babelweb2 -http $PORT -static $STATIC_DIR +ExecReload=/bin/kill -SIGUSR1 $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target +``` + +After that you can reload the units: +``` +systemctl daemon-reload +``` + +For babelweb2 to work, we still need to specify the arguments. For this we can create an environment file `/etc/default/babelweb2`: +``` +PORT=: +STATIC_DIR=/usr/share/babelweb2/static/ +``` +Here we replace `` with the port on which the Babelweb2 interface should be available. The default is 8080, but you can also use 33124, for example. From 2d1086dc788673d8ccb6e243154838c114fefe9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 8 Jan 2023 16:26:00 +0100 Subject: [PATCH 2/3] remove double empty line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Küthe --- docs/routing/babeld/babelweb2.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/routing/babeld/babelweb2.md b/docs/routing/babeld/babelweb2.md index e4748db..f6037ff 100644 --- a/docs/routing/babeld/babelweb2.md +++ b/docs/routing/babeld/babelweb2.md @@ -22,7 +22,6 @@ By default, the web interface runs on port 8080. You can also specify a differen babelweb2 uses the local configuration interface of babeld. This must have been activated beforehand. babeld assumes that this is active on `[::1]:33123`. Alternatively, you can specify the endpoint with the `-node=` flag. - ## Install as Systemd Unit In order to install babelweb2 as a systemd unit, we must first install the necessary files into the system. For this we can execute the following commands in the babelweb2 git directory: From 518c4f0673fd14c34b830fac7f10106c4a6503cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 8 Jan 2023 20:23:02 +0100 Subject: [PATCH 3/3] replace User=nobody with DynamicUser=yes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Küthe --- docs/routing/babeld/babelweb2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/routing/babeld/babelweb2.md b/docs/routing/babeld/babelweb2.md index f6037ff..2f52e6a 100644 --- a/docs/routing/babeld/babelweb2.md +++ b/docs/routing/babeld/babelweb2.md @@ -40,7 +40,7 @@ Documentation=https://github.com/Vivena/babelweb2 [Service] LimitNOFILE=1048576 LimitNPROC=512 -User=nobody +DynamicUser=yes EnvironmentFile=/etc/default/babelweb2 ExecStart=/usr/local/bin/babelweb2 -http $PORT -static $STATIC_DIR ExecReload=/bin/kill -SIGUSR1 $MAINPID