Ticket #364 (new task)
defunct process
| Reported by: | michael | Owned by: | jluebbe |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | framework/oeventsd | Version: | milestone5 |
| Keywords: | Cc: |
Description
when i add an rule in rules.yaml like this
-
trigger: IdleState?() filters: HasAttr?(status, "idle_prelock") actions: Command('/tmp/test.py')
the programm starts but becomes a zombie process.
Change History
comment:2 Changed 4 years ago by michael
test.py
#!/usr/bin/python
import sys
import dbus
def Suspendchecker():
if usage_iface.GetResourceState(u'GPS'):
idle_iface.SetState('idle_prelock')
print "GPS is on"
sys.exit(0)
if not power_iface.GetOnBattery():
idle_iface.SetState(u'idle_prelock')
print "AC is present"
sys.exit(0)
usage_iface.Suspend()
bus = dbus.SystemBus()
usage_obj = bus.get_object('org.freesmartphone.ousaged', '/org/freesmartphone/Usage')
usage_iface = dbus.Interface(usage_obj, 'org.freesmartphone.Usage')
power_obj = bus.get_object('org.freesmartphone.odeviced', '/org/freesmartphone/Device/PowerSupply/apm')
power_iface = dbus.Interface(power_obj, 'org.freesmartphone.Device.PowerSupply')
idle_obj = bus.get_object('org.freesmartphone.odeviced', '/org/freesmartphone/Device/IdleNotifier/0')
idle_iface = dbus.Interface(idle_obj,'org.freesmartphone.Device.IdleNotifier')
Suspendchecker()
Note: See
TracTickets for help on using
tickets.

Could you provide a sample test.py with with you test this?