Find the answer to your Linux question:
Results 1 to 3 of 3
Hello All, I am trying to get DBus Working in Perl. And I can't seem to get that special tick. I can control DBus in C, it took me a ...
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422

    DBus Perl :(

    Hello All,
    I am trying to get DBus Working in Perl. And I can't seem to get that special tick.
    I can control DBus in C, it took me a while but I got it done now..
    I understand the Python Snipers I find however I need it in Perl.

    here is the Source Code I wrote/stole..

    Greeting.pm
    Code:
    #!/usr/bin/perl -w
    package Greeting;
    use Net::DBus::Exporter 'test.dbus.perl';
    use base 'Net::DBus::Object';
    
    sub new 
    {
       my ($class, $service) = @_;
       my $self = $class->SUPER::new($service,'/test/dbus/perl');
       bless $self, $class;
    }
    
    dbus_method('SayHello');
    
    sub SayHello
    {
       my $self = shift;
       return "VICTORY!";
    }
    client.pl
    Code:
    #!/usr/bin/perl -w
    
    use Net::DBus;
    
    my $app = Net::DBus->session
    	->get_service('test.dbus.perl')
    	->get_object(/test/dbus/perl')
    ;
    
    $app->SayHello();
    server.pl
    Code:
    #!/usr/bin/perl -w
    use Net::DBus;
    use Net::DBus::Reactor;
    use Greeting;
    
    my $service = Net::DBus->session->export_service('test.dbus.perl');
    my $object = Greeting->new($service);
    Net::DBus::Reactor->main->run();
    OnExecute
    Code:
    org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute dbus-launch to autolaunch D-Bus session.
    I googled for the Error, However I couldn't find anything. So, can anyone help me with this?
    Last edited by RobinVossen; 09-14-2009 at 11:50 AM.
    New Users, please read this..
    Google first, then ask..

  2. #2
    Just Joined!
    Join Date
    Jun 2009
    Location
    Toronto
    Posts
    18
    Do you have dbus-launch in your path?

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    I guess not, however I dont have an application called dbus-launch installed on this system either..

    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...