[mythtv-users] Detecting an active DLNA client (0.21)?

Robert Houghton robbadler at gmail.com
Wed Jan 12 22:36:28 UTC 2011


On Wed, Jan 12, 2011 at 11:02 AM, Raymond Wagner <raymond at wagnerrp.com>wrote:

> On 1/12/2011 13:42, Romain Kang wrote:
>
>> One challenge: My master backend (0.21) will shut itself down using
>> the idle detection command, and looking in mythbackend.log, I don't
>> see that it knows there's an active DLNA client.  Is there some
>> method that an idle detection command can use to determine the
>> system should not go to sleep?
>>
>
> The routines that are run to check for backend shutdown are not aware of
> content being streamed by the web server.
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


$query = $db->prepare("SELECT id " .
                      "FROM jobqueue WHERE status=1 OR status=3 OR status=4
OR status=5 OR status=8 OR status=9;");
$query->execute || Die "Cannot query mythtv for jobqueue. Stay awake";
$result = $query->fetchrow_array;
$query->finish;
if ( $result )
{
  Die "Mythjobqueue has jobs queued. Don't shut down!\n";
}

$result = system('netstat -e|grep nfs');
if ( $result>>8 == 0 )
{
  Die "Someone is using NFS, don't shut down!\n";
}

$result = system('netstat -e|grep lds-dump|grep -v CLOSE_WAIT');
if ( $result>>8 == 0 )
{
  Die "Someone is using DLNA, don't shut down!";
}

$result = system('netstat -e|grep microsoft-ds|grep -v CLOSE_WAIT');
if ( $result>>8 == 0 )
{
  Die "Someone is using SAMBA, don't shut down!";
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20110112/9e38580a/attachment.htm>


More information about the mythtv-users mailing list