LFS211: LAB 5.8 - VNC Server Autostart - Timeout with provided [email protected]
I have been trying to create a
[email protected] and ran into issues that I managed to fix. However, since I fixed it by modifying the service content proposed in the Solutions of the lab 5.8, I propose here the content that made it work:
Static hostname: UbuntuLTS
Operating System: Ubuntu 20.04.2 LTS
Kernel: Linux 5.8.0-44-generic
[email protected] proposed by lab solutions:
/etc/systemd/system$ cat [email protected] [Unit] Description=Remote desktop service (VNC) on port :%I After=syslog.target network.target [Service] Type=forking User=username ExecStartPre=-/usr/bin/vncserver -kill :%i ExecStart=/usr/bin/vncserver :%i -localhost PIDFile=/home/username/.vnc/%H:%i.pid ExecStop=-/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target
systemctl daemon-reload and starting it with
systemctl start [email protected] resulted in a timeout:
Job for [email protected] failed because a timeout was exceeded. See "systemctl status [email protected]" and "journalctl -xe" for details.
Commenting out the both lines:
# ExecStartPre=-/usr/bin/vncserver -kill :%i # PIDFile=/home/username/.vnc/%H:%i.pid
Made the service to start and run properly.
It seems that the first comment is needed as the ExecStartPre fails to kill the (in)-existing vncserver process, while the second comment I am not sure why it was timing out as I do have in my ~/.vnc folder a
UbuntuLTS:41.pid, corresponding to the
How relevant is that PIDFile line in the service, and why doesnt it work?