Aparentemente, este es un error conocido en Empathy, así que decidí lanzar Empathy desde un script que verifica si la red está activa (conectándose a http://www.google.com , el verdadero latido del corazón de Internet :) Si la red no funciona, dormirá durante 5 segundos y volverá a intentarlo, hasta que lo intente 30 veces
Este es el script (llamado waitfornet.py )
#!/usr/bin/python
from urllib2 import urlopen, URLError
from subprocess import Popen
from time import sleep
from sys import argv
MAX_TRIES = 30
DELAY = 5
if len (argv) < 2:
print ('Check for network connectivity and run a command once the net is up')
print ('Tries up to %d times waiting %d seconds between each try' % (MAX_TRIES, DELAY))
print ('\nUSAGE: python waitfornet.py <command to run>')
else:
while True:
MAX_TRIES -= 1
if MAX_TRIES < 0:
raise ValueError ('Reached the max iteration count and the net is still down')
try:
data = urlopen('http://www.google.com')
except URLError:
# if there's a problem connecting to google, that must mean
# that the net is still down, so sleep 5 seconds and try again
print ('Internet is down... retrying...')
sleep (DELAY)
continue
# if you got here it means that the urlopen succeded
pid = Popen([argv[1], ' '.join(argv[1:])]).pid
break
y así es como lo ejecuto desde el menú "Aplicaciones de inicio":
~/scripts/waitfornet.py empathy