[systemd-devel] Instantiated sockets?

David Strauss david at davidstrauss.net
Tue Jan 22 13:50:45 PST 2013


On Fri, Jan 18, 2013 at 10:03 PM, Ian Pilcher <arequipeno at gmail.com> wrote:
> Accept=true

This, alone, would instantiate a new service for each client
connection. But, combined with MaxConnections=1, you'll deny any
connections if one is active.

> ExecStart=-/usr/bin/Xvnc -SecurityTypes None -query 127.0.0.1 -inetd -once :10
> It would be nice if one could do something like this.
>
>  systemctl enable xvnc@:11.socket
>
> Can anyone think of any way to accomplish this?

With xvnc at .service, systemd will start an additional instance for each
client connection. But, you can't have them named after a pool like
:10, :11, etc.

The command I see for Xvnc via inetd-style activation [1] is like:

/usr/bin/Xvnc -inetd -query localhost -once -geometry 1024x768 -depth 24

This does not connect incoming sessions to specific displays. It
instantiates a display with the requested properties on connection.

If you *did* want a mapping from port to display, you could try
creating an Accept=false socket unit for each port, specifying
Service=xvnc@<display>.service for each socket unit, and having
xvnc at .service use the instance ID as the display ID. I have not tested
this, but it's probably something that systemd should support if it
doesn't now. I'm not sure if Xvnc would be happy running with
Accept=false, though.

You could also create a socket and service pair for each port, as you
suggest. That would allow keeping Accept=true set in each socket.

[1] http://users.skynet.be/luc.pauwels/luc/unix/vnc-from-inetd.html

--
David Strauss
   | david at davidstrauss.net
   | +1 512 577 5827 [mobile]


More information about the systemd-devel mailing list