Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon mode fails to run as system service #42

Open
Grumbel opened this issue Apr 11, 2013 · 7 comments
Open

Daemon mode fails to run as system service #42

Grumbel opened this issue Apr 11, 2013 · 7 comments

Comments

@Grumbel
Copy link
Member

Grumbel commented Apr 11, 2013

See discussion at:

https://groups.google.com/d/topic/xboxdrv/L-mRi0AIVuA/discussion

If xboxdrv is run as root it will enable "--dbus system" instead of "--dbus session", but in newer versions of Ubuntu this results in:

$ sudo xboxdrv --daemon 
xboxdrv 0.8.5 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmx.de> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING 
for details. 

[ERROR] XboxdrvDaemon::run(): fatal exception: failed to get unique dbus name: Connection ":1.68" is not     allowed to own the service "org.seul.Xboxdrv" due to security policies in the configuration file

Workaround is to run xboxdrv as dbus session with "--dbus session".

@sm-Fifteen
Copy link

PS: Yeah, this reply is a little late.
It's okay, it's not like it had been almost a year and the default xpad driver had since then gained supprt for my shady Razer controller, which is the reason why I started using xboxdrv in the first place as it supported manual input of USB codes.
Oh, they did?
Jokes aside, if I find that upstart script draft, I might try to get it working again. Xboxdrv still offers a couple of nice adventages compared to xpad, and I wouldn't mind starting to use it again.
It's good to see you're back on working on this too, I thought this project was dead.

@raelgc
Copy link

raelgc commented Apr 12, 2014

@Grumbel: use --dbus disabled to stop errors about dbus on Ubuntu 14.04.

Here I start xboxdrv with this upstart script at /etc/init/xboxdrv.conf:

# xboxdrv.conf
start on filesystem
pre-start script
    # clean up joysticks
    rm -f /dev/input/js*
end script
exec xboxdrv -D --detach-kernel-driver --silent --dbus disabled

Not related: Maybe there is a better way to remove old joysticks. Usually xpad add them totally wrong, at least here, the x360 receiver is attached as joystick, and joystick 0 started as second. So, I have to cleanup.

@kurumushi
Copy link

On many distros changing ownership of dbus services is restricted by default. You just need to create a dbus rule to allow it.

On my system this file is /etc/dbus-1/system.d/org.seul.Xboxdrv.conf

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus
Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <policy context="default">
    <allow own="org.seul.Xboxdrv"/>
  </policy>
</busconfig>

@raelgc
Copy link

raelgc commented May 26, 2014

@kurumushi Thank you for point this. I'll update my wrapper package, ubuntu_xboxdrv with this info and re-enable dbus.

@Grumbel Grumbel added this to the v0.8.8 milestone Nov 5, 2015
Grumbel added a commit that referenced this issue Nov 6, 2015
This should save us from having to deal with busconfig, see:

#42

Fixes #42
@Grumbel Grumbel closed this as completed in 575170d Nov 6, 2015
@tgurr
Copy link
Contributor

tgurr commented Nov 7, 2015

With 575170d applied I get the following error:

xboxdrv[4712]: [ERROR] XboxdrvDaemon::run(): fatal exception: failed to open connection to bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

when trying to start xboxdrv via

ExecStart=/usr/bin/xboxdrv --daemon --silent --deadzone 4000 --deadzone-trigger 10%

@Grumbel
Copy link
Member Author

Grumbel commented Nov 7, 2015

Hmpf, forgot about that. It's mentioned in issue #16, but with --dbus session now being the default it will trigger for everybody trying to launch xboxdrv on boot. Guess there is no way around install a busconfig and going back to --dbus system.

@Grumbel Grumbel reopened this Nov 7, 2015
@Grumbel
Copy link
Member Author

Grumbel commented Nov 9, 2015

Changed it now so that --dbus session will be used when run as user or when DISPLAY is present and --dbus system will be used when running as root and DISPLAY is missing. Also added a bit of docu to the README. Not ideal, but will have to do for the 0.8.8 release.

@Grumbel Grumbel removed this from the v0.8.8 milestone Nov 9, 2015
ryukinix added a commit to ryukinix/xboxdrv-bin that referenced this issue Oct 15, 2017
I don't use. This is pretty useless. Dbus is dead for me.

xboxdrv/xboxdrv#42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants