1#!/usr/bin/python 2 3import gobject 4import dbus 5import dbus.mainloop.glib 6 7def event(pid, reason, value): 8 print "pid %s %s: %s" % (pid, reason, value) 9 10if __name__ == '__main__': 11 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) 12 13 bus = dbus.SystemBus() 14 15 bus.add_signal_receiver(event, bus_name="org.chromium.dhcpcd", 16 signal_name = "Event") 17 18 mainloop = gobject.MainLoop() 19 mainloop.run() 20