summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-11-16 01:16:33 +0300
committerDevaev Maxim <[email protected]>2018-11-16 01:16:33 +0300
commit1ddfc2058459cdfe81fb36cbe1f361cd570d16fc (patch)
treef0133492fc008d01b13f02754716d44b001da561
parent1c8e4dbe04351d838d650a735da5387555af8353 (diff)
unprivileged kvmd daemon
-rw-r--r--PKGBUILD1
-rw-r--r--configs/systemd/kvmd.service2
-rw-r--r--kvmd.install7
3 files changed, 10 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 117f1d2e..ed467d09 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -23,6 +23,7 @@ depends=(
makedepends=(python-setuptools)
source=("$url/archive/v$pkgver.tar.gz")
md5sums=(SKIP)
+install=kvmd.install
build() {
diff --git a/configs/systemd/kvmd.service b/configs/systemd/kvmd.service
index ee5f2d68..5427d4c9 100644
--- a/configs/systemd/kvmd.service
+++ b/configs/systemd/kvmd.service
@@ -3,6 +3,8 @@ Description=The main Pi-KVM daemon
After=network.target network-online.target nss-lookup.target
[Service]
+User=kvmd
+Group=kvmd
Type=simple
Restart=always
RestartSec=3
diff --git a/kvmd.install b/kvmd.install
new file mode 100644
index 00000000..b77e1248
--- /dev/null
+++ b/kvmd.install
@@ -0,0 +1,7 @@
+post_install() {
+ id kvmd &>/dev/null || useradd -r -c "The main Pi-KVM daemon" -s /sbin/nologin kvmd
+}
+
+post_remove() {
+ userdel kvmd &>/dev/null
+}