Page 1 of 1

VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/25 09:36:44
by khere
Hello,

From some time im getting an error when my server is rebooted (power failure).

I cant gconnect to VNCserver, i must manualy remove /tmp/.X11/X1 file and restart vncserver.

Im using CentOS 7.6.1810 and tigervnc-server 1.8.0.13.

I was looking for sollution for some time but there is only one: rm file from temp and restart. Is there any way to do this automaticaly or to solve this problem? Seems that problem is popular ;)

Re: VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/25 11:19:17
by tunk
You could try to put the rm command in /etc/rc.d/rc.local

Re: VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/25 11:37:18
by TrevorH
What does your systemd unit file look like? Run e.g. systemctl cat vncserver@:1

Re: VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/25 18:50:40
by khere
I was follow instalation guide on tigervnc page:
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Replace <USER> with the actual user name and edit vncserver
# parameters appropriately
# (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`

[botek@desktop~]$ systemctl cat vncserver@\:1.service

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

[Service]
Type=forking

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l botek -c "/usr/bin/vncserver %i"
PIDFile=/home/botek/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

Re: VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/25 19:49:08
by TrevorH
I wanted to see the unit file because it has changed several times during the lifetime of CentOS 7.0 - 7.6 and I wondered if you had an older copy. You don't, it's the same as the sample one included in the package.

So, I am not sure why it would be doing this for you but I do have one suggestion about how to bypass it but it depends on how much you use /tmp. There is another systemd unit file that is disabled by default - tmp.mount. If that's enabled using systemctl enable tmp.mount then systemd will mount /tmp on tmpfs and allocate it by default to be half the size of your RAM. Don't worry, it won't necessarily use all that as it only uses the amount of RAM that's the size of the files you place on it. It's also swap backed so the data can be swapped out if the RAM is required for something more useful.

Benefits of using tmpfs for /tmp - it's faster, it starts empty on each reboot. Reasons not to use it include needing to preserve the contents of /tmp over reboots and requiring more space than you have RAM+swap.

Re: VNCtiger - locked file tmp/.x11-unix/X1 after unexpected reboot

Posted: 2019/05/29 17:29:41
by khere
Thanks a lot thats solve my problem ;)