(Solved) Cron "periodic interface reset" not working

Started by Alphakilo, February 15, 2022, 03:11:06 PM

Previous topic - Next topic
February 15, 2022, 03:11:06 PM Last Edit: February 15, 2022, 04:19:46 PM by Alphakilo
Hi,

I have a barely working dual WAN setup that broke further :-[
I've set up a cronjob to do an "Periodic interface reset" every day at 05:00 that worked throughout 21.x, but seems to be broken with 22.1. Every morning the pppoe0 interface is down.

There seems to be an issue shutting down the PPP daemon:

<30>1 2022-02-15T05:00:00+01:00 gateway.domain.tld ppp 29540 - [meta sequenceId="1"] Multi-link PPP daemon for FreeBSD
<30>1 2022-02-15T05:00:00+01:00 gateway.domain.tld ppp 29540 - [meta sequenceId="2"] 
<30>1 2022-02-15T05:00:00+01:00 gateway.domain.tld ppp 29540 - [meta sequenceId="3"] process 29540 started, version 5.9
<30>1 2022-02-15T05:00:00+01:00 gateway.domain.tld ppp 71757 - [meta sequenceId="4"] caught fatal signal TERM
[...]
<30>1 2022-02-15T05:00:30+01:00 gateway.domain.tld ppp 29540 - [meta sequenceId="79"] waiting for process 71757 to die...
<30>1 2022-02-15T05:00:31+01:00 gateway.domain.tld ppp 29540 - [meta sequenceId="80"] can't lock /var/run/pppoe_wan.pid after 30 attempts
<30>1 2022-02-15T05:00:31+01:00 gateway.domain.tld ppp 71757 - [meta sequenceId="81"] [wan] Bundle: Shutdown
<30>1 2022-02-15T05:00:31+01:00 gateway.domain.tld ppp 71757 - [meta sequenceId="82"] [wan_link0] Link: Shutdown
<30>1 2022-02-15T05:00:31+01:00 gateway.domain.tld ppp 71757 - [meta sequenceId="83"] process 71757 terminated


After that, no automatic attempt to restart the daemon is made. A manual reload brings the interface back up with no issues.
I've attached the latest logfile and a screenshot of the cronjob.

Hello,

Sounds like https://github.com/opnsense/core/commit/d2ea9e9a44c

# opnsense-patch d2ea9e9a44c

It's included in 22.1.1 tomorrow.

FWIW, people reported this and said if you run the cron job twice it works again if you don't feel like applying the patch just yet.


Cheers,
Franco

February 15, 2022, 04:15:46 PM #2 Last Edit: February 15, 2022, 04:19:18 PM by Alphakilo
Thanks for the quick reply!

Quote from: franco on February 15, 2022, 03:12:43 PM
if you don't feel like applying the patch just yet.

franco, I always feel adventurous😅
That, plus the patch makes a lot of sense. Let me fire up cron, I'll report back in a few.

Edit:

Sure did the trick! Cheers!

Thanks for confirming. :)

As you can see from the code -k argument was being used for over a decade but now it doesn't work all the time and not much was changed in the area. Not sure where that problem originates (our code, OS?) from but it's safer not to trust the daemon anyway like we do in general indeed.


Cheers,
Franco

can i ask which interface i should use in the parameter option on the cron job for periodic interface reset?
in my interface overview i have on the WAN(opt1,pppoe0) ... is it op1 or pppoe0 oder both (comma separated)?

thanks
OPNsense 23.7 VM  <=  DrayTek Vigor 165 (vDSL2 35b 250/50)
         \/
on Proxmox 8.0
         \/
on Minisforum HM90

"opt1" would be correct in this case. The identifiers are either "wan", "lan" or "optX"

In recent 22.1.8 you can also see them from the Interfaces: Assignments page.


Cheers,
Franco