summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraysky <graysky@archlinux.us>2015-10-19 08:27:27 -0400
committergraysky <graysky@archlinux.us>2015-10-19 14:06:53 -0400
commitf4e620ac62c61db4090fc241944471b6a2807242 (patch)
tree993db61c3508a041899c8e289b65f5cc3a55011a
parent02cbc222caf331d51bfaf50fc7d467ddcf25073c (diff)
downloadtigervnc-f4e620ac62c61db4090fc241944471b6a2807242.tar.gz
tigervnc-f4e620ac62c61db4090fc241944471b6a2807242.zip
provide a systemd user service unit for vncserver
-rw-r--r--contrib/systemd/user/vncserver@.service26
1 files changed, 26 insertions, 0 deletions
diff --git a/contrib/systemd/user/vncserver@.service b/contrib/systemd/user/vncserver@.service
new file mode 100644
index 00000000..7797504b
--- /dev/null
+++ b/contrib/systemd/user/vncserver@.service
@@ -0,0 +1,26 @@
+#
+# /usr/lib/systemd/user/vncserver@.service
+#
+# 1. Switches for vncserver should be entered in ~/.vnc/config rather than
+# hard-coded into this unit file. See the vncserver(1) manpage.
+#
+# 2. Users wishing for the server to continue running after the owner logs
+# out MUST enable 'linger' with loginctl like this:
+# `loginctl enable-linger username`
+#
+# 3. The server can be enabled and started like this once configured:
+# `systemctl --user start vncserver@:<display>.service`
+# `systemctl --user enable vncserver@:<display>.service`
+
+[Unit]
+Description=Remote desktop service (VNC)
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
+ExecStart=/usr/bin/vncserver %i
+ExecStop=/usr/bin/vncserver -kill %i
+
+[Install]
+WantedBy=default.target