edited script sometimes freezes xbmc
#1
First off, I've got no idea what I'm doing I just threw this together from already existing scripts and edited stuff to make it work for my case.

Now my problem is that when I stop the script manually I get

Code:
..../service.vdr.powersafe/default.py): script didn't stop in 5 seconds - let's kill it

That's all fine and good since the script still works as it should but sometimes on xbmc exit it seems to freeze up because of this (or something else I did), any pointers where I go wrong?

Things I added:

Code:
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, inhibit_shutdown
....

            # check netstat            
            def check_netstat():
                    if inhibit_shutdown.check_services():
                            return True

                    return False
.....

                elif check_netstat():
                            print "vdr.powersave: powersave postponed - Network activity ..."


As you can see in addition to the original functions of the powersave service this loads the file inhibit_shutdown.py to check for activity on certain ports before shutting down the htpc.

Complete scripts:

powersave.py http://pastebin.com/EvDZ8eMt
inhibit_shutdown.py http://pastebin.com/SfX7tm2C

Original creator of the powersave script http://forum.xbmc.org/showthread.php?tid=115899
Reply
#2
I've managed to get everything into one file, but I still get the freezing every now and then, it does look pretty random from my point of view which makes it harder to track down.

Updated powersave.py

http://pastebin.com/S4AF84VH

Here is the complete script, I've noticed that you can only get the original by signing up to vdr-portal.de

https://www.dropbox.com/s/f8k3b6srceuyfz...ersafe.zip

And a debug log when xbmc hangs on shutdown:

http://pastebin.com/kEvQQkSm
Reply

Logout Mark Read Team Forum Stats Members Help
edited script sometimes freezes xbmc0