Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - rabinnh

#1
Sorry, I showed the command after I had edited it.  Prior to editing it had "-h".
#2
I have mini PC with 2 NICs running OPNsense for the last 2 years, and it's been great.  I have the PC plugging into an APC SmartUPS and the apcupsd plugin installed.

All my other systems are Linux, and the way I have them configured they shut down when there is 5 minutes of battery life left.  Also, they are all configured to start back up when power is restored (I've configured the UPS to wait until the it's 80% charged before restoring power).

So today we had a short power outage, and after 30 minutes the power was restored.  All the Linux boxes came back up gracefully, but the OPNsense box was stuck with the following on the console:

"The operating system is halted, press any key to reboot."

So even when power was restored, it would just sit there waiting.  Not ideal if you're away from the office.  Investigation revealed that this file:

/usr/local/etc/apcupsd/apccontrol
controls what happens on APC UPS events.  As you can see in this case statement:

        doshutdown)
                printf "Beginning Shutdown Sequence" | wall
                ${SHUTDOWN} -p now "apcupsd initiated shutdown"

When told to shutdown the command being run is

shutdown -h now
This works great on Linux, however on FreeBSD it halts the machine and doesn't power it off.  If you want the machine to power off (as I do), modify the command instead for FreeBSD:

shutdown -p now
I hope that this helps others.


#3
Awesome and easy. I'll give it a try in an hour or so.

You rock.
#4
Good afternoon.  I lost my authenticator app (I won't go into how) and now I can't login to my firewall.  I found this entry:  https://forum.opnsense.org/index.php?topic=26614.msg128622#msg128622

Which recommended going into single user mode and entering:

opnsense-shell password

I did so, and went through all the prompts to revert to the local database and enter a new password.  However, after confirming the password, the scripts crash.  I have attached a screenshot of the crash that I took with my phone, so sorry about how hard it is to read.

In the meantime, is there some way I can fiddle around with a config file to enable me to get access again?

Thanks