LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-04-2014, 01:50 AM   #1
markus-n
LQ Newbie
 
Registered: Apr 2014
Distribution: Xubuntu, Arch
Posts: 20

Rep: Reputation: Disabled
How does systemd know if x11vnc is connected to a client ?


... and how can I overcome it ?

Hi folks,

I am currently trying to set up x11vnc as service started during bootup on Arch Linux.

This is my service file:
Code:
[Unit]
Description=VNC Server for X11
Requires=display-manager.service
After=display-manager.service

[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -rfbauth /etc/x11vnc.pass -rfbport 5900 -display WAIT:0 -auth /var/run/lxdm/lxdm-\:0.auth -forever -bg -o /var/log/x11vnc.log -xkb -noxrecord -noxfixes -noxdamage -nomodtweak
and it almost works.

Almost means: It works if a client connects within 2 minutes. Otherwise, x11vnc gets killed. According to my log file, x11vnc caught signal 15.

The WAIT:0 option is necessary, because otherwise x11vnc my start too fast and fail to connect to x11. With WAIT, it will connect to x11 when the client connects.

I also tried Type=oneshot instead of Type=forking (and without the -bg option).
During the 5 minutes, systemctl status shows "Active (running)", and after that it shows "Failed".

Then I start the service manually with systemd start x11vnc, it freezes until the client connects or the timeout occurs.

I have verified the ExecStart command is correct by directly running it from the shell. This way, it works, no matter when a client connects. Even several hours later is fine.

This means that systemd must know somehow if x11vnc is connected to a client.
How does it know this ? And how can I tell it not to kill it even when there is no client ?

Thanks and Regards
Markus
 
Old 04-05-2014, 03:29 AM   #2
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Sorry to post an alternative rather than a direct fix but I am an ex VNC begrudging lover, having known it was dirty and insecure but having no truly viable alternative in X...... until NOMACHINE. It's built to use SSH. It's nice.
 
Old 04-05-2014, 10:21 AM   #3
markus-n
LQ Newbie
 
Registered: Apr 2014
Distribution: Xubuntu, Arch
Posts: 20

Original Poster
Rep: Reputation: Disabled
@enorbet
Thank you for the link. I'll have a look at it.

@all
But anyway, I am interested in an answer to my original question, because it is something I want to learn and understand. Maybe I will need it in future for another service ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VPN Client can't get to IPSec connected network zhjim Linux - Networking 1 06-06-2012 01:24 AM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM
SmartCard reader connected to LTSP client Undermind Linux - Server 0 01-03-2011 10:53 AM
x11vnc server crashes when client connects vin109 Linux - Newbie 1 04-12-2008 08:49 PM
when client connected to eth0 server freezes ichi Linux - Wireless Networking 5 03-26-2005 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration