Seite 1 von 1
D-Bus-Objekt wird nicht veröffentlicht
Verfasst: 12. Oktober 2010 15:29
von LonelyPixel
Hallo,
ich habe eine Anwendung, die ein Objekt auf dem D-Bus-Systembus veröffentlicht, das von einer anderen Anwendung dann verwendet wird. Die D-Bus-Konfiguration habe ich entsprechend angepasst, dass das erlaubt wird. Mit OpenSUSE 10.3 hat das auch alles noch funktioniert (Qt 4.3.1), aber seit dem Upgrade auf 11.2 funktioniert genau das nicht mehr (Qt 4.5.3). Die Funktion QDBusConnection.registerObject meldet Erfolg, aber die andere Anwendung kann das Objekt nicht abrufen. Also entweder das Veröffentlichen ist jetzt kaputt, oder das Abrufen - oder Qt hat sich irgendwo unterwegs verändert. Der Code hat sich jedenfalls nicht geändert.
Kann man diesen D-Bus denn irgendwie von innen anschauen, um zu sehen, was dort grade alles registriert ist?
Re: D-Bus-Objekt wird nicht veröffentlicht
Verfasst: 21. Dezember 2010 21:42
von koppi
LonelyPixel hat geschrieben:
Kann man diesen D-Bus denn irgendwie von innen anschauen, um zu sehen, was dort grade alles registriert ist?
Es gibt da ein Perl-Script:
dbus-lists-objects.pl
Code: Alles auswählen
#!/usr/bin/perl
=head1 NAME
dbus-list-services.pl - List the services available in D-Bus.
=head1 DESCRIPTION
This program list the services registered in D-Bus. It uses the introspection
mechanism defined in D-Bus for listing all services.
=head1 SYNOPSIS
dbus-list-services.pl [OPTION]
Options:
--system use the system bus.
--session use the session bus.
=head1 AUTHOR
Emmanuel Rodriguez E<lt>potyl@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2008 by Emmanuel Rodriguez
=cut
use strict;
use warnings;
use Net::DBus;
use Data::Dumper;
use Getopt::Long qw(:config auto_help pass_through);
exit main();
sub main {
my $use_session = 1;
GetOptions(
'system' => sub {$use_session = 0},
'session' => sub {$use_session = 1},
);
# Get the D-Bus object
my $bus = $use_session ? Net::DBus->session : Net::DBus->system;
my $dbus = $bus
->get_service('org.freedesktop.DBus')
->get_object('/org/freedesktop/DBus')
or die "Can't get the DBus instance"
;
# Get the list of services offered by the bus
my $names = $dbus->ListNames();
foreach my $name (sort @{ $names }) {
# Discard all unnamed services (these are the D-Bus clients)
next if $name =~ /^:\d+\.\d+$/;
print "$name\n";
}
return 0;
}
Und ein Perl-Script:
dbus-list-services.pl
Code: Alles auswählen
#!/usr/bin/perl
=head1 NAME
dbus-list-services.pl - List the services available in D-Bus.
=head1 DESCRIPTION
This program list the services registered in D-Bus. It uses the introspection
mechanism defined in D-Bus for listing all services.
=head1 SYNOPSIS
dbus-list-services.pl [OPTION]
Options:
--system use the system bus.
--session use the session bus.
=head1 AUTHOR
Emmanuel Rodriguez E<lt>potyl@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2008 by Emmanuel Rodriguez
=cut
use strict;
use warnings;
use Net::DBus;
use Data::Dumper;
use Getopt::Long qw(:config auto_help pass_through);
exit main();
sub main {
my $use_session = 1;
GetOptions(
'system' => sub {$use_session = 0},
'session' => sub {$use_session = 1},
);
# Get the D-Bus object
my $bus = $use_session ? Net::DBus->session : Net::DBus->system;
my $dbus = $bus
->get_service('org.freedesktop.DBus')
->get_object('/org/freedesktop/DBus')
or die "Can't get the DBus instance"
;
# Get the list of services offered by the bus
my $names = $dbus->ListNames();
foreach my $name (sort @{ $names }) {
# Discard all unnamed services (these are the D-Bus clients)
next if $name =~ /^:\d+\.\d+$/;
print "$name\n";
}
return 0;
}
Bei Qt sind die Programme
qdbus und
qdbusviewer dabei. Vielleicht hilft Dir das schon, ansonsten muß Du in den
/etc/init.d/ schauen ("
$ grep dbus /etc/init.d/*"), wo und wie der dbus-Daemon auf Deinem System gestartet wird und eventuell die Debug-Ausgabe aktivieren.
Verfasst: 21. Dezember 2010 21:54
von LonelyPixel
Den qdbusviewer kannte ich zur Zeit des letzten Beitrags hier noch nicht. Der hat das Problem dann bereits vor einigen Wochen gelöst, trotzdem danke.
