summaryrefslogtreecommitdiff
path: root/nshd.service.in
diff options
context:
space:
mode:
Diffstat (limited to 'nshd.service.in')
-rw-r--r--nshd.service.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/nshd.service.in b/nshd.service.in
new file mode 100644
index 0000000..7760687
--- /dev/null
+++ b/nshd.service.in
@@ -0,0 +1,30 @@
+[Unit]
+Description=Name Service hackers.git Daemon
+Requires=nshd.socket
+Wants=nss-user-lookup.target
+Before=nss-user-lookup.target
+
+[Service]
+Type=notify
+# Use our setuid program instead of setting User= because otherwise it
+# would deadlock as it tries to poll the nslcd socket to ask if it
+# knows who the user is. It would time out after 1 minute, but that's
+# still not good.
+ExecStart=@@bindir@/nshd-setuid nshd @user@ @bindir@/nshd
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+Also=nshd.socket
+
+# The following is a workaround for a scheduling deadlock in systemd
+# v230 (and probably other versions). What "naturally" happens is
+# that we would be socket-activated by systemd-logind which is
+# dbus-activated during systemd' dbus_init(), which is called when
+# dbus.service starts. However, systemd is buggy and won't activate
+# any services during dbus_init(), so the whole thing deadlocks. A
+# timeout means that boot eventually continues, but we are left with a
+# half-working system.
+[Unit]
+Before=dbus.service
+[Install]
+WantedBy=dbus.service