diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-17 17:50:17 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-18 21:55:35 +0700 |
| commit | 182a79905737010fa135d101be656144b7b0f39a (patch) | |
| tree | 2074073942e549924d29fd1c9f84571a827c14c5 /_ops | |
| parent | 97b8266d5a6c95dd70c255845aafbb82cacc97d9 (diff) | |
| download | haminer-182a79905737010fa135d101be656144b7b0f39a.tar.xz | |
all: create new dummy backend to test backend in HAProxy
The haminer-dummy-backend run in container and serve two ports in HTTP
and TCP modes.
Diffstat (limited to '_ops')
4 files changed, 31 insertions, 0 deletions
diff --git a/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.path b/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.path new file mode 100644 index 0000000..5261287 --- /dev/null +++ b/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.path @@ -0,0 +1,9 @@ +[Unit] +Description="Watch haminer-dummy-backend" + +[Path] +PathChanged=/data/haminer/bin/haminer-dummy-backend +Unit=systemctl-restart@%p.service + +[Install] +WantedBy=default.target diff --git a/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.service b/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.service new file mode 100644 index 0000000..3f6e41a --- /dev/null +++ b/_ops/haminer-test/mkosi.extra/etc/systemd/system/haminer-dummy-backend.service @@ -0,0 +1,14 @@ +## SPDX-FileCopyrightText: 2024 M. Shulhan <ms@kilabit.info> +## SPDX-License-Identifier: GPL-3.0-or-later + +[Unit] +Description=haminer-dummy-backend +After=syslog.target network.target + +[Service] +ExecStart=/data/haminer/bin/haminer-dummy-backend +Restart=always +RestartSec=10s + +[Install] +WantedBy=multi-user.target diff --git a/_ops/haminer-test/mkosi.extra/etc/systemd/system/systemctl-restart@.service b/_ops/haminer-test/mkosi.extra/etc/systemd/system/systemctl-restart@.service new file mode 100644 index 0000000..800316e --- /dev/null +++ b/_ops/haminer-test/mkosi.extra/etc/systemd/system/systemctl-restart@.service @@ -0,0 +1,6 @@ +[Unit] +Description=systemctl-restart@%i + +[Service] +Type=oneshot +ExecStart=/bin/systemctl restart %i diff --git a/_ops/haminer-test/mkosi.finalize.chroot b/_ops/haminer-test/mkosi.finalize.chroot index eb19874..200b78f 100755 --- a/_ops/haminer-test/mkosi.finalize.chroot +++ b/_ops/haminer-test/mkosi.finalize.chroot @@ -5,3 +5,5 @@ chown postgres:postgres /var/lib/postgres/data/pg_hba.conf sudo systemctl enable haproxy.service sudo systemctl enable postgresql.service +sudo systemctl enable haminer-dummy-backend.path +sudo systemctl enable haminer-dummy-backend.service |
