OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: iamperson347 on March 31, 2021, 02:53:10 am

Title: Two reboot commands needed to reboot opnsense (WebUI)
Post by: iamperson347 on March 31, 2021, 02:53:10 am
Hi All,

I'm running into an odd issue where my install of opnsense will not reboot through the WebUI the first time. The dialog pops up that the reboot is happening, and the "shutdown chime" plays on the physical machine, but after a few seconds I get sent back to the dashboard. If I go to the reboot screen and select to reboot again, the system then properly reboots.

This also appears to affect reboots required/triggered by upgrades.

However, using "reboot" command via ssh shell session works fine.

I was trying to look through logs to see if I could determine what is going on but the system log doesn't really show anything at the time the issue occurs. The configd.log says "rebooting system" (or something to that effect), but that is it.

Any ideas on where else I can look to determine what might be holding things up?
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: iamperson347 on March 31, 2021, 04:33:20 am
It seems this may be related to ntopng and redis. When I manually ran /usr/local/etc/rc.reboot, it appears redis gets shutdown before ntopng. This causes ntopng to hang while shutting down.

I'll have to look into changing the order to see if that will fix the issue. I tried modifying the ntopng rc script to REQUIRE redis, but that didn't seem to help.
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: franco on March 31, 2021, 08:56:58 am
It's been reported previously. We would suggest taking this to ntopng since we can't do much about it.


Cheers,
Franco
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: iamperson347 on March 31, 2021, 12:30:04 pm
It looks like someone reported it. We will see what ntopng devs have to say.

https://github.com/ntop/ntopng/issues/5127

Does the opnsense plugins build process generate the rc scripts, or does it come from the upstream package?
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: chemlud on March 31, 2021, 01:02:54 pm
Hmmm, will it take longer than 2 hours before "Closed" because not an official package installed and apparently related to BSD script? ;-)
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: iamperson347 on April 02, 2021, 03:41:20 am
It's been reported previously. We would suggest taking this to ntopng since we can't do much about it.


Cheers,
Franco

Hi Franco,

Is it possible that something like this would help?

https://github.com/iamperson347/core/commit/cb75a0003389d6181403c0d10ef425423b6ce12f

I tested it on my machine and it seems to fix the issue. I don't know if this would have any ill effects, but shutting things down in the reverse of rcorder seems logical when the rc.freebsd file is called with "stop."

What do you think?

Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: franco on April 02, 2021, 07:58:23 pm
Yes, looks promising at first glance. Can you open an official PR on GitHub to discuss?


Thanks,
Franco
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: tswalker on April 09, 2021, 07:22:07 pm
hi, i made the report over  on ntopng about it... not sure they are able to address this.  regardless, i'm interested in a workaround too and though perhaps a service ordering for shutdown might work as ntopng has that dependency on redis.

i have no clue how to make that happen though
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: iamperson347 on April 10, 2021, 05:44:28 pm
I think this issue should be resolved for opnsense via this commit (not in a released version yet).

https://github.com/opnsense/core/commit/7316071974b790b6262b65465649df61aa55c500
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: franco on April 11, 2021, 07:38:42 pm
Yep, to apply from console:

# opnsense-patch 7316071


Cheers,
Franco
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: tswalker on April 15, 2021, 09:33:27 pm
Yep, to apply from console:

# opnsense-patch 7316071


Cheers,
Franco

confirmed as resolved.  i closed the ntopng issue.  thanks you all!!!
Title: Re: Two reboot commands needed to reboot opnsense (WebUI)
Post by: franco on April 16, 2021, 10:44:33 am
Ok, I'll add it to 21.1.5 for next week. :)


Thanks,
Franco