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

Issues related to applications and software problems
Post Reply
khere
Posts: 3
Joined: 2019/05/25 09:25:48

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

Post by khere » 2019/05/25 09:36:44

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 ;)

tunk
Posts: 550
Joined: 2017/02/22 15:08:17

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

Post by tunk » 2019/05/25 11:19:17

You could try to put the rm command in /etc/rc.d/rc.local

User avatar
TrevorH
Forum Moderator
Posts: 25847
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2019/05/25 11:37:18

What does your systemd unit file look like? Run e.g. systemctl cat vncserver@:1
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

khere
Posts: 3
Joined: 2019/05/25 09:25:48

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

Post by khere » 2019/05/25 18:50:40

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

User avatar
TrevorH
Forum Moderator
Posts: 25847
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2019/05/25 19:49:08

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.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

khere
Posts: 3
Joined: 2019/05/25 09:25:48

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

Post by khere » 2019/05/29 17:29:41

Thanks a lot thats solve my problem ;)

Post Reply