Active Topics

 



Notices


Reply
Thread Tools
jehan's Avatar
Posts: 55 | Thanked: 14 times | Joined on Mar 2010
#1
Since I have ongoing problems with wifi power saving mode and my AP which does not seem to like it I disabled power saving for all connections and wrote a little script to control power saving on wlan0 via iwconfig. Every time I receive or initiate a call dbus-scripts runs this script to disable power saving.

This works fine so far but sometimes dbus-scipts seem not to listen for events anymore and therefore doesn't execute the script.

To be sure and to examine the problem I started dbus-scripts by upstart in the following way:
Code:
exec run-standalone.sh /usr/sbin/dbus-scripts --debug --session > \
/tmp/dbus-debug
Everytime when I notice that the dbus-scripts daemon does not execute the script also the daemon does not write any debugging information to the file /tmp/dbus-debug anymore which leads me to the assumption that the daemon stops listining.

Actually I have two daemons running, one for system events and one for session events. The daemon listening to system events gets started by upstart with the script in event.d provided by the dbus-scripts package. The second daemon listening to session events gets started like described above - it's basically the same script as described here.

In /etc/dbus-scripts.d I placed a file with the following contents:
Code:
#:power saving on
/home/user/bin/power_saving_on.sh * * \ 
org.freedesktop.Telepathy.Channel Closed

#:power saving off
/home/user/bin/power_saving_off.sh * * \ 
org.freedesktop.Telepathy.Connection.Interface.Requests CreateChannel
The scripts power_saving_off.sh and power_saving_on.sh look like:

Code:
#!/bin/sh

# power saving off
iwconfig wlan0 power off

# send notification
dbus-send --type=method_call --dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.SystemNoteInfoprint string:"Power \
Saving Off"
Code:
#!/bin/sh

# power saving on
iwconfig wlan0 power on

# send notification
dbus-send --type=method_call --dest=org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.SystemNoteInfoprint string:"Power \
Saving On"
My question is: why does the dbus-scripts daemon unexpectedly stop listening? Sometimes I have to reboot the device several times to make it listen again. Did I make a mistake?
 
Posts: 187 | Thanked: 41 times | Joined on May 2010
#2
Actually i have the same problem with dbus-scripts with --session ...
apparently it dies and leave subprocesses in zombie state ...
for example , if inside a session event i call a script that has a line with 'sleep' command, the sleep will became a zombie and the dbus-script-session will stop listening ...
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#3
I have to admit I never tested --session. Does the issue with sleep in script occur always, or only sometimes?
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 
Posts: 187 | Thanked: 41 times | Joined on May 2010
#4
well , i will have to test more ... but apparently always ...
I removed the sleep and try a command like:
pidof skyhost >> /tmp/pidof (pidof became a zombie and dbus-script --session) stop listening ...
have tried ps -xau > /tmp/ps , always zombie ...

if i do dbus-scripts --session --debug i can see it matches but stop listening ...
 
Posts: 187 | Thanked: 41 times | Joined on May 2010
#5
i did a very small test

# cat /etc/dbus-scripts/skype_call
/opt/customs/scripts/test * com.nokia.policy.telephony com.nokia.policy.telephony call_request /org/freedesktop/Telepathy/Connection/spirit/skype/*



# cat /opt/customs/scripts/test
#!/bin/sh
pidof skyhost > /tmp/pidof

# run-standalone.sh /usr/sbin/dbus-scripts --session

tried to make a skype call , so the event call_request would be signaled

now ps shows me:

2089 root 2160 S /bin/sh
2103 root 2084 S /bin/sh /usr/bin/run-standalone.sh /usr/sbin/dbus-scr
2112 root 3324 S /usr/sbin/dbus-scripts --session
2115 root 2084 D /bin/sh /opt/customs/scripts/test :1.19 com.nokia.pol
2116 root 0 Z [pidof] -> ZOMBIE

pstree shows me :
sh───run-standalone.───dbus-scripts───test───pidof

and here dbus-script is locked and not listening or executing anything anymore ...
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:01.