get rhythmbox information from other user

darknez

New Member
I have Rhythmbox running on my desktop, and I want to be able to control it from remotely via a web interface. I'm having problems accessing it, however, because \[code\]rhythmbox-client\[/code\] is complaining that the user (www-data) that is trying to access it doesn't a) have as X session running, and b) doesn't have access to my rhythmbox dbus information.\[code\](rhythmbox-client:13954): Rhythmbox-WARNING **: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.\[/code\]I'm running apache, php on ubuntu 10.04. The following methods have also been tried by calling the php script via php cli from a different user (sshing into my own box with a different user)I've tried these approaches:
  • calling system() and exec() from the php script with "rhythmbox-client --print-playing --no-start --no-resent"
  • using DBus directly in php as well as a python script (calling it from the php script with system()/exec())
  • using \[code\]setuid()\[/code\], \[code\]setruid()\[/code\], \[code\]seteuid()\[/code\] in a C program and calling it via php.
I'm at a loss now. Is this even possible?[EDIT]I have used @IvanGoneKrazy's suggestion and taken the environ code from this similar question. Now I have this code with this error message:\[code\]import subprocess, osp = subprocess.Popen('dbus-launch', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)for var in p.stdout: sp = var.split('=', 1) os.environ[sp[0]] = sp[1][:-1]os.system('rhythmbox-client --print-playing')\[/code\]error message: \[code\](rhythmbox-client:15377): Rhythmbox-WARNING **: Launch helper exited with unknown return code 1\[/code\]
 
Back
Top