한국어
Linux Programming
 

dbus-send 명령을 사용하면 시스템에서 사용 가능한 서비스를 출력할 수 있다.

 

Session 버스 :

dbus-send --session           \
  --dest=org.freedesktop.DBus \
  --type=method_call          \
  --print-reply               \
  /org/freedesktop/DBus       \
  org.freedesktop.DBus.ListNames

 

System 버스 :

dbus-send --system            \
  --dest=org.freedesktop.DBus \
  --type=method_call          \
  --print-reply               \
  /org/freedesktop/DBus       \
  org.freedesktop.DBus.ListNames

다음과 같은 결과를 출력해 준다.

method return time=1672301936.016979 sender=org.freedesktop.DBus -> destination=:1.28 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string "org.freedesktop.login1"
      string "org.freedesktop.timesync1"
      string "org.freedesktop.systemd1"
      string "org.freedesktop.Avahi"
      string "org.bluez"
      string ":1.12"
      string ":1.0"
      string ":1.1"
      string ":1.2"
      string ":1.3"
      string ":1.28"
      string "fi.epitest.hostap.WPASupplicant"
      string ":1.4"
      string "fi.w1.wpa_supplicant1"
      string ":1.5"
   ]

 

특히 유용한 D-Bus 기본 인터페이스org.freedesktop.DBus.Introspectable.Introspect 를 호출하면 관심있는 서비스의 인터페이스를 검사할 수 있다:

dbus-send --system --type=method_call --print-reply \
   --dest=org.bluez \
   / \
   org.freedesktop.DBus.Introspectable.Introspect

결과는 다음과 같다.

method return time=1672302110.949720 sender=:1.5 -> destination=:1.31 serial=30 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
</method></interface><interface name="org.freedesktop.DBus.ObjectManager"><method name="GetManagedObjects"><arg name="objects" type="a{oa{sa{sv}}}" direction="out"/>
</method><signal name="InterfacesAdded"><arg name="object" type="o"/>
<arg name="interfaces" type="a{sa{sv}}"/>
</signal>
<signal name="InterfacesRemoved"><arg name="object" type="o"/>
<arg name="interfaces" type="as"/>
</signal>
</interface><node name="org"/></node>"
번호 제목 글쓴이 날짜 조회 수
44 리눅스 Qt 응용프로그램 AppImage 로 구축 makersweb 2024.01.07 389
43 GRUB의 timeout 설정 makersweb 2023.11.07 362
42 lubuntu 22.04 LTS 설치 file makersweb 2023.01.23 1141
» 시스템에서 사용 가능한 D-Bus 서비스를 보려면? makersweb 2022.12.29 1026
40 리눅스에서 네트워크 구성 makersweb 2022.06.11 2737
39 D-Bus ObjectManager file makersweb 2022.02.12 524
38 ifconfig 는 대부분 ip 명령으로 대체 makersweb 2022.02.12 1144
37 SocketCAN 유틸 사용방법 file makersweb 2022.02.05 6624
36 dbus-broker를 기본 DBus 구현으로 설정 makersweb 2021.01.20 985
35 리눅스 오디오 스택과 아키텍처 file makersweb 2020.09.02 2767
34 wayland-scanner 를 통해 Wayland 프로토콜 코드생성 makersweb 2020.06.08 830
33 Wayland 의 Client Application 프로그래밍 기본 루틴 makersweb 2020.06.04 1522
32 Wayland 의 주요 객체들 makersweb 2020.06.04 794
31 Weston 의 설명 및 관련 컴포넌트 makersweb 2020.06.03 2368
30 64비트 리눅스에서 32비트 응용프로그램을 실행하려면 makersweb 2020.02.29 1682
29 initramfs (initial ram file system: 초기 램 파일 시스템) makersweb 2020.02.25 1815
28 플랫폼 디바이스 드라이버 개발 시 많이 사용되는 커널 API 및 매크로 makersweb 2020.01.28 4603
27 PATH에 새로운 경로 추가 makersweb 2019.09.19 378
26 리눅스 컴파일러 최신으로 업데이트 linux 2018.12.26 1879
25 libblkid - USB Storage의 정보 가져오기 makersweb 2018.10.18 647