Warning: Can't synchronize with repository "(default)" (No changeset 96d22ec3fa3ef6de3ea8dc0d7d398adc9aa071cf in the repository). Look in the Trac log for more information.

Ticket #364 (new task)

Opened 4 years ago

Last modified 4 years ago

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:1 Changed 4 years ago by daniel

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

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()

comment:3 Changed 4 years ago by daniel

Jan, iirc you wrote the code for that. Could you take care of this?

comment:4 Changed 4 years ago by mickey

ping?

Note: See TracTickets for help on using tickets.