View Single Post
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?