diğer kullanıcıdan rhythmbox bilgi alabilirsiniz

0 Cevap php

Ben Rhythmbox benim masaüstünde çalışan var, ve ben bir web arayüzü üzerinden uzaktan onu kontrol edebilmek istiyorum. Sorunlarım erişmesini yaşıyorum, ancak çünkü rhythmbox-client erişmek için çalışan kullanıcı (www-data)) X oturumu koşma gibi, ve b) 'farkeder etmez şikayetçi t benim rhythmbox dbus bilgilere erişebilir.

(rhythmbox-client:13954): Rhythmbox-WARNING **: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

Ben ubuntu 10.04 üzerinde apache, php koşuyorum. Aşağıdaki yöntemleri de (farklı bir kullanıcı ile kendi kutuya sshing) farklı bir kullanıcı php cli aracılığıyla php dosyası arayarak denenmiştir

Ben bu yaklaşımlar denedim:

  • "- print-çalma - no-start - hayır cak rhythmbox-client" ile php script sistemi () ve exec () çağrı
  • doğrudan php gibi bir python komut dosyası DBUS kullanılarak () (sistemi ile php komut çağırarak / exec ())
  • Bir C programında setuid(), setruid(), seteuid() kullanarak ve php yoluyla çağırıyor.

Ben şimdi bir kayıp değilim. Bu bile mümkün mü?

[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:

import subprocess, os

p = 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')

hata mesajı:

(rhythmbox-client:15377): Rhythmbox-WARNING **: Launch helper exited with unknown return code 1

0 Cevap