Skip to content

Instantly share code, notes, and snippets.

@cedced19
Created December 4, 2020 21:02
Show Gist options
  • Save cedced19/81858aec4434dfbc29e02e4f748eaf6e to your computer and use it in GitHub Desktop.
Save cedced19/81858aec4434dfbc29e02e4f748eaf6e to your computer and use it in GitHub Desktop.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l cjung -c "/usr/bin/vncserver %i -geometry 1280x1024"
PIDFile=/run/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment