Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/vncserver@.service/:2
          └ 13584 /usr/bin/Xvnc :2 -geometry 1280x1024 -SecurityTypes=None -AlwaysShared=1
share|improve this question

1 Answer 1

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 +
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.