From 31720629e68f65592be4382906a6e300c08b4445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Wyszy=C5=84ski?= Date: Tue, 3 Dec 2024 16:54:03 +0100 Subject: [PATCH] fix: add system user creation in arch package - Add systemd-sysusers configuration to create modbus-relay user - Add user to uucp group for serial port access - Update PKGBUILD to install sysusers configuration --- dist/arch/PKGBUILD | 3 +++ dist/arch/modbus-relay.sysusers | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 dist/arch/modbus-relay.sysusers diff --git a/dist/arch/PKGBUILD b/dist/arch/PKGBUILD index 7644f89..dcbf99e 100644 --- a/dist/arch/PKGBUILD +++ b/dist/arch/PKGBUILD @@ -28,6 +28,9 @@ package() { # Systemd service install -Dm644 "dist/arch/modbus-relay.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service" + # Systemd sysusers + install -Dm644 "dist/arch/modbus-relay.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + # Documentation install -Dm644 "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/licenses/$pkgname/LICENSE-MIT" diff --git a/dist/arch/modbus-relay.sysusers b/dist/arch/modbus-relay.sysusers new file mode 100644 index 0000000..2f62892 --- /dev/null +++ b/dist/arch/modbus-relay.sysusers @@ -0,0 +1,3 @@ +# Create modbus-relay system user and add to uucp group +u modbus-relay - "Modbus TCP to RTU relay service" /nonexistent /usr/sbin/nologin +m modbus-relay uucp