Preventing MythTV from loading more than once...

  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: SELECT data, created, headers, expire, serialized FROM cache_filter WHERE cid = '1:289350c21ea1c17b46e78d08e7ed7ee0' in /var/www/mythdora/html/includes/cache.inc on line 26.
  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: UPDATE cache_filter SET data = '<p>Hello,</p>\n<p>Does anyone know if there is a way to rig the MythTV app on my desktop so it cannot load more than once? My 5-year-old likes to watch movies and she knows to click on the MythTV icon and where to go to find movies. But sometimes she\'s a little impatient and accidentally loads several instances of MythTV at the same time. When this happens, it\'s difficult to switch between them with the wireless keyboard and it bogs everything down.</p>\n<p>Any suggestions?</p>\n<p>Rob</p>\n', created = 1369077294, expire = 1369163694, headers = '', serialized = 0 WHERE cid = '1:289350c21ea1c17b46e78d08e7ed7ee0' in /var/www/mythdora/html/includes/cache.inc on line 109.
  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: SELECT data, created, headers, expire, serialized FROM cache_filter WHERE cid = '1:763c7d1f6fcb64aa99507842f64c4d90' in /var/www/mythdora/html/includes/cache.inc on line 26.
  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: UPDATE cache_filter SET data = '<p>I would think there\'s a .pid file somewhere that you can check before starting another instance? Or you can do a ps -ef |grep mythfrontend.</p>\n<p>something like:</p>\n<p>ps ax |grep \"mythfrontend\" &gt; /tmp/myth.pid</p>\n<p>head -n 1 /tmp/myth.pid &gt; /tmp/mythfe.pid</p>\n<p>set -- $(cut -b1-5 /tmp/mythfe.pid)</p>\n<p>pid=\"$*\"</p>\n<p>if [ -z \"$pid\" ] ;<br />\nthen<br />\n let pid=0<br />\nfi</p>\n<p>echo \"pid $pid\"</p>\n<p>if [ $pid -gt 0 ] ; then<br />\n echo detected running $pid<br />\nelse</p>\n<p> echo starting!!<br />\nfi</p>\n', created = 1369077294, expire = 1369163694, headers = '', serialized = 0 WHERE cid = '1:763c7d1f6fcb64aa99507842f64c4d90' in /var/www/mythdora/html/includes/cache.inc on line 109.
  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: SELECT data, created, headers, expire, serialized FROM cache_filter WHERE cid = '1:4e1804d306b7db31e8b2c00744119b9b' in /var/www/mythdora/html/includes/cache.inc on line 26.
  • user warning: Table './drupal_gding/cache_filter' is marked as crashed and should be repaired query: UPDATE cache_filter SET data = '<p>I\'ll give it a try.</p>\n<p>Thank you,</p>\n<p>Rob</p>\n', created = 1369077294, expire = 1369163694, headers = '', serialized = 0 WHERE cid = '1:4e1804d306b7db31e8b2c00744119b9b' in /var/www/mythdora/html/includes/cache.inc on line 109.

Hello,

Does anyone know if there is a way to rig the MythTV app on my desktop so it cannot load more than once? My 5-year-old likes to watch movies and she knows to click on the MythTV icon and where to go to find movies. But sometimes she's a little impatient and accidentally loads several instances of MythTV at the same time. When this happens, it's difficult to switch between them with the wireless keyboard and it bogs everything down.

Any suggestions?

Rob

get pid

I would think there's a .pid file somewhere that you can check before starting another instance? Or you can do a ps -ef |grep mythfrontend.

something like:

ps ax |grep "mythfrontend" > /tmp/myth.pid

head -n 1 /tmp/myth.pid > /tmp/mythfe.pid

set -- $(cut -b1-5 /tmp/mythfe.pid)

pid="$*"

if [ -z "$pid" ] ;
then
let pid=0
fi

echo "pid $pid"

if [ $pid -gt 0 ] ; then
echo detected running $pid
else

echo starting!!
fi

Good suggestion...

I'll give it a try.

Thank you,

Rob