Skip to content

Instantly share code, notes, and snippets.

@chris-short
Created March 29, 2019 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-short/34a1c96a10174a5983dde0f8484f5efb to your computer and use it in GitHub Desktop.
Save chris-short/34a1c96a10174a5983dde0f8484f5efb to your computer and use it in GitHub Desktop.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
WorkingDirectory=/home/cshort
User=cshort
Group=cshort
PIDFile=/home/cshort/.vnc/elmer%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i -geometry 1920x1080 > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver -autokill %i
ExecStop=/usr/bin/vncserver -kill %i
Restart=on-success
RestartSec=15
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment