vnc script for systemd

Kernels, Network, and Services configuration
Post Reply
Message
Author
vcba79
Posts: 9
Joined: 2021-04-28 12:43

vnc script for systemd

#1 Post by vcba79 »

Hi,

My debian 10.9 has xfce4, tightvnc server installed.If I
login as normal user and run

vncserver :1

I got vnc connection working. Now I write a script
for systemd as below, vnc service wont start.
What is wrong with this script?

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=fork
User=vincent
Group=vincent

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
ExecStop=/usr/bin/vncserver -kill %i
PIDFile=/home/vincent/.vnc/%H.pid

[Install]
WantedBy=multi-user.target

Post Reply