OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: Alphakilo on February 15, 2022, 03:11:06 PM

Title: (Solved) Cron "periodic interface reset" not working
Post by: Alphakilo on February 15, 2022, 03:11:06 PM
Hi,

I have a barely working (https://forum.opnsense.org/index.php?topic=23546.0) 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.
Title: Re: Cron "periodic interface reset" not working
Post by: franco on February 15, 2022, 03:12:43 PM
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
Title: Re: Cron "periodic interface reset" not working
Post by: Alphakilo on February 15, 2022, 04:15:46 PM
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!
Title: Re: (Solved) Cron "periodic interface reset" not working
Post by: franco on February 15, 2022, 05:17:06 PM
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
Title: Re: (Solved) Cron "periodic interface reset" not working
Post by: 3x3cut0r on June 03, 2022, 09:17:27 AM
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
Title: Re: (Solved) Cron "periodic interface reset" not working
Post by: franco on June 03, 2022, 11:37:55 AM
"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