summaryrefslogtreecommitdiff
path: root/webiot
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-08-18 20:18:56 +0200
committerxengineering <me@xengineering.eu>2024-08-18 20:18:56 +0200
commit15ed599559b43ecd9942f3f4b97c072d5c97a025 (patch)
tree8ce7c20f8b06a324446fa663616def164f037306 /webiot
parent853781a2a621181e3ebf370af3422b0a010c740a (diff)
downloadpkgbuilds-15ed599559b43ecd9942f3f4b97c072d5c97a025.tar
pkgbuilds-15ed599559b43ecd9942f3f4b97c072d5c97a025.tar.zst
pkgbuilds-15ed599559b43ecd9942f3f4b97c072d5c97a025.zip
webiot: Add systemd unit and system user
Diffstat (limited to 'webiot')
-rw-r--r--webiot/PKGBUILD10
-rw-r--r--webiot/sysuser.conf1
-rw-r--r--webiot/webiot.service11
3 files changed, 18 insertions, 4 deletions
diff --git a/webiot/PKGBUILD b/webiot/PKGBUILD
index 09bf190..f34abaf 100644
--- a/webiot/PKGBUILD
+++ b/webiot/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: xengineering <me@xengineering.eu>
pkgname=webiot
pkgver=0.1.0
-pkgrel=1
+pkgrel=2
pkgdesc="Lightweight IoT web server"
arch=('x86_64' 'aarch64')
url="https://xengineering.eu/git/webiot"
@@ -32,7 +32,9 @@ build() {
}
package() {
- cd "${srcdir}/${pkgname}"
- install -D -m 755 "${srcdir}/${pkgname}/build/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
- install -D -m 644 "${srcdir}/${pkgname}/config/default.json" "${pkgdir}/etc/${pkgname}/config.json"
+ cd "${srcdir}"
+ install -D -m 755 "${pkgname}/build/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -D -m 644 "${pkgname}/config/default.json" "${pkgdir}/etc/${pkgname}/config.json"
+ install -D -m 644 "../${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+ install -D -m 644 "../sysuser.conf" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
}
diff --git a/webiot/sysuser.conf b/webiot/sysuser.conf
new file mode 100644
index 0000000..f93a91a
--- /dev/null
+++ b/webiot/sysuser.conf
@@ -0,0 +1 @@
+u webiot - "webiot system user" -
diff --git a/webiot/webiot.service b/webiot/webiot.service
new file mode 100644
index 0000000..f331d60
--- /dev/null
+++ b/webiot/webiot.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=IoT server with web interface
+After=network.target
+
+[Service]
+User=webiot
+Group=webiot
+ExecStart=/usr/bin/webiot -c /etc/webiot/config.json
+
+[Install]
+WantedBy=multi-user.target