Deleted Account
Posts: 0

igmp proxy crashes - script to check and restart automatically

It seems like every Sunday when I wake up to watch football I have no picture.  I ssh into the router and type

 

restart igmp-proxy

, it warns me that igmp-proxy is not currently running, and I'm good for another week.  I haven't seen any messages in the log so I don't know what is happening (is there a way to turn on more verbose logging for igmp-proxy?)

 

It's easy enough to restart but sometimes I am not home and a family member wants to watch TV when it goes down, and it has also interfered with my PVR recordings.  I saw @hazuki 's excellent VPN restarting script (https://community.ubnt.com/t5/EdgeMAX/ERLite-Auto-Restart-VPN/m-p/1141989/highlight/true#M52418) and adapted it to igmp-proxy:

 

1. create a file called /config/igmpcheck.sh with the following contents:

 

#!/bin/bash
pidof igmpproxy >/dev/null
if [[ $? -ne 0 ]] ; then
        echo "restarting igmp-proxy"
        /bin/vbash -ic 'restart igmp-proxy'
fi

2. Make it executable

 

sudo chmod +x /config/igmpcheck.sh

3. Set it to run every 5 minutes

 

configure
set system task-scheduler task igmpcheck executable path /config/igmpcheck.sh
set system task-scheduler task igmpcheck interval 5m
commit
save
exit

There's probably a more elegant solution but this seems to work.  I have tested it manually but I have not seen if it has saved me or not.  If you want to test it yourself:

 

1.

pidof igmpproxy

this spits out the process id for igmp-proxy, something like 1724

2.

sudo kill 1724

Replace 1724 with whatever PID that pidof spat out. This will shut down igmp-proxy

3.

. /config/igmpcheck.sh

you should get the following output:

 

restarting igmp-proxy
Warning: igmpproxy not running.
Starting IGMP proxy

Now perform step 3 again.  Since igmp-proxy is running you should see no output

Veteran Member
Posts: 4,135
Registered: ‎05-15-2014
Kudos: 1561
Solutions: 283

Re: igmp proxy crashes - script to check and restart automatically

Deleted Account
Posts: 0

Re: igmp proxy crashes - script to check and restart automatically

I'm running 1.9.0, I don't think this behaviour was present in older firmware versions but I'm not totally sure.

Emerging Member
Posts: 95
Registered: ‎12-23-2013
Kudos: 9
Solutions: 1

Re: igmp proxy crashes - script to check and restart automatically

I'm running 1.9.1 on a ER-X.  I also see igmpproxy randomly stops (nothing in logs).

 

I'm happy to see your script.  I'm going to give it a try.  Might be nice to run it even more frequently?  Also be nice to have it log something so we can know that igmpproxy is still dying?

 

thanks...

Deleted Account
Posts: 0

Re: igmp proxy crashes - script to check and restart automatically

When I was having this issue it was only once a week and actually it hasn't happened for about a month.   Every 5 minutes is probably lots but feel free to change "interval 5m" in step 3 to "interval 1m" or something.

 

Maybe it was fixed in 1.9.1?  It also could have been fixed by a configuration change of some kind, I'm not sure.

Emerging Member
Posts: 95
Registered: ‎12-23-2013
Kudos: 9
Solutions: 1

Re: igmp proxy crashes - script to check and restart automatically

I'm running 1.9.1, the issue is still present there.  

 

It doesn't happen to me very often either - maybe once every couple of weeks.

 

I was just thinking that if someone was watching TV, I'd like to minimize the time that it is down, so I set it to 1m.

 

Of course, I won't know if it ever stops...  I may modify the script to log somewhere if I get a chance...

Emerging Member
Posts: 95
Registered: ‎12-23-2013
Kudos: 9
Solutions: 1

Re: igmp proxy crashes - script to check and restart automatically

Here is the modified script that logs restarts to a file:

 

#!/bin/bash

LOG_FILE=/var/log/igmpproxy-restart.log

if [ ! -f $LOG_FILE ];
then
        touch $LOG_FILE
fi

pidof igmpproxy >/dev/null
if [[ $? -ne 0 ]] ; then
        echo $(date) "restarting igmp-proxy" >> $LOG_FILE
        /bin/vbash -ic 'restart igmp-proxy'
fi
New Member
Posts: 1
Registered: ‎02-13-2017

Re: igmp proxy crashes - script to check and restart automatically

Just to say thanks for this - I have a similar problem with igmpproxy randomly crashing on my ER-X running 1.9.1.

 

As at least half of our TV comes through multicast, this doesn't make me very popular with the rest of the household. Man Happy