TigerVNC decided to start itself
by taylorkh from LinuxQuestions.org on (#4S8X4)
I believe this issue started after upgrading to CentOS 7.7. At least it became obvious at that point. I have 3 "servers" - actually just server boxes filled with hard drives for archive storage. Cheaper than a NAS :) They run CentOS and are headless. I access them with ssh and call up a VNC session if necessary using this scriptCode:#!/bin/bash
vncserver -kill :1
vncserver :1 -geometry 1600x900 -depth 16This has worked well for years. After the upgrade to 7.7 I experienced this when the script tried to kill any old sessionCode:[ken@taylor22 ~]$ vncserver -kill :1
Can't find file /home/ken/.vnc/taylor22:1.pid
You'll have to kill the Xvnc process manually
[ken@taylor22 ~]$ vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS IDNotice that I cannot find the offending session. After some investigation I found this clueCode:[ken@taylor22 ~]$ systemctl status vncserver@:1
a- vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: failed (Result: resources) since Thu 2019-10-10 10:52:22 EDT; 8min ago
Process: 1283 ExecStart=/usr/sbin/runuser -l ken -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 1274 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Oct 10 10:52:19 taylor22 systemd[1]: Starting Remote desktop service (VNC)...
Oct 10 10:52:22 taylor22 systemd[1]: New main PID 1389 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 10:52:22 taylor22 systemd[1]: New main PID 1389 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 10:52:22 taylor22 systemd[1]: Failed to start Remote desktop service (VNC).
Oct 10 10:52:22 taylor22 systemd[1]: Unit vncserver@:1.service entered failed state.
Oct 10 10:52:22 taylor22 systemd[1]: vncserver@:1.service failed.I disabled the offending service. Now, when I bring up a server, connect with ssh and run my script I find a VNC session running as :1 as expected.
The question is... Where broken service come from? I have upgraded these servers continuously from CentOS 7.3 or 7.4 and never seen a phantom VNC session running. Any ideas?
TIA,
Ken


vncserver -kill :1
vncserver :1 -geometry 1600x900 -depth 16This has worked well for years. After the upgrade to 7.7 I experienced this when the script tried to kill any old sessionCode:[ken@taylor22 ~]$ vncserver -kill :1
Can't find file /home/ken/.vnc/taylor22:1.pid
You'll have to kill the Xvnc process manually
[ken@taylor22 ~]$ vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS IDNotice that I cannot find the offending session. After some investigation I found this clueCode:[ken@taylor22 ~]$ systemctl status vncserver@:1
a- vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: failed (Result: resources) since Thu 2019-10-10 10:52:22 EDT; 8min ago
Process: 1283 ExecStart=/usr/sbin/runuser -l ken -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 1274 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Oct 10 10:52:19 taylor22 systemd[1]: Starting Remote desktop service (VNC)...
Oct 10 10:52:22 taylor22 systemd[1]: New main PID 1389 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 10:52:22 taylor22 systemd[1]: New main PID 1389 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 10:52:22 taylor22 systemd[1]: Failed to start Remote desktop service (VNC).
Oct 10 10:52:22 taylor22 systemd[1]: Unit vncserver@:1.service entered failed state.
Oct 10 10:52:22 taylor22 systemd[1]: vncserver@:1.service failed.I disabled the offending service. Now, when I bring up a server, connect with ssh and run my script I find a VNC session running as :1 as expected.
The question is... Where broken service come from? I have upgraded these servers continuously from CentOS 7.3 or 7.4 and never seen a phantom VNC session running. Any ideas?
TIA,
Ken