0

I would like to run Xvnc on Fedora 16 as a service. Not vncserver, given that carries the weight of a full window manager, but just Xvnc to start X.

I would also like "xhost +" to run on the X session. Here's what I have in my systemctl script so far:

[Service]
Type=simple
User=build
Environment=DISPLAY=:2
ExecStart=/usr/bin/Xvnc :2 -geometry 1280x1024 -SecurityTypes=None -AlwaysShared=1
ExecStartPost=-xhost +
ExecStop=/usr/bin/vncserver -kill :2

The result is the X session is working. and not prompting for passwords ("=None"). But I cannot connect to that X server from other hosts (xhost +), which is what I need.

Why is that ExecStartPost not working? The "systemctl status" does not show any output of this, but could I find that output from somewhere else?

Here is that status, just for reference:

      Loaded: loaded (/lib/systemd/system/vncserver@:2.service; enabled)
      Active: active (running) since Thu, 11 Apr 2013 11:02:26 -0400; 2s ago 
     Process: 13577 ExecStop=/usr/bin/vncserver -kill :2 (code=exited, status=2)
    Main PID: 13584 (Xvnc)
      CGroup: name=systemd:/system/[email protected]/:2
          └ 13584 /usr/bin/Xvnc :2 -geometry 1280x1024 -SecurityTypes=None -AlwaysShared=1

1 Answer 1

0

My solution was to make a script wrapper, where it runs "Xvnc", sleeps a second (optional?), and runs "xhost+" on the new DISPLAY. It works now.

#!/bin/csh
/usr/bin/Xvnc $* -geometry 1280x1024 -SecurityTypes=None -AlwaysShared=1 &
while ($#argv)
  if ($argv[1] =~ ":*") then
    setenv DISPLAY $argv[1]
  endif
  shift
end

sleep 1
xhost +

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .