Skip to content

firmware: ability to shutdown after upgrade#10264

Open
sopex wants to merge 10 commits into
opnsense:masterfrom
sopex:shutdown-test
Open

firmware: ability to shutdown after upgrade#10264
sopex wants to merge 10 commits into
opnsense:masterfrom
sopex:shutdown-test

Conversation

@sopex
Copy link
Copy Markdown
Member

@sopex sopex commented May 6, 2026

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

Details

This PR uses the dialog box that lets a user know that the upgrade will initiate a restart, to present the user with the ability to power off instead. If no choice is made after 30 seconds, it automatically restarts.

Maybe the countdown should be removed and just wait for an answer, but it seems like ample time, and the dialog box shows up immediately after a user action, so no chance to be forgotten.


Related issue

Closes: #10245

@fichtner
Copy link
Copy Markdown
Member

fichtner commented May 6, 2026

I was thinking something similar but without a persistent option using a checkbox in the reboot dialog. Probably going to write this from scratch while testing which is in this case easier than doing review cycles.

@sopex
Copy link
Copy Markdown
Member Author

sopex commented May 6, 2026

I was thinking something similar but without a persistent option using a checkbox in the reboot dialog. Probably going to write this from scratch while testing which is in this case easier than doing review cycles.

Sure, rewrite it but this is not persistent and in the dialog box :)
Review, what is that? My code needs review? :)
In all seriousness, this works as is. I did multiple updates and worked as expected.

@fichtner
Copy link
Copy Markdown
Member

fichtner commented May 6, 2026

well it is persistent: <shutdown type="BooleanField"/>

it would be more flexible to have this as an optional parameter for update/upgrade actions so it can be used for API-based maintenance too

@sopex
Copy link
Copy Markdown
Member Author

sopex commented May 6, 2026

well it is persistent: <shutdown type="BooleanField"/>

it would be more flexible to have this as an optional parameter for update/upgrade actions so it can be used for API-based maintenance too

Yeah ok. It flips back immediately after being used. It's a persistent variable, not a persistent option.

Comment thread src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php Outdated
Comment thread src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php Outdated
@fichtner
Copy link
Copy Markdown
Member

fichtner commented May 6, 2026

As a general note the Power menu has "Power Off" and we should follow that terminology.

@sopex
Copy link
Copy Markdown
Member Author

sopex commented May 6, 2026

As a general note the Power menu has "Power Off" and we should follow that terminology.

It seemed to me that only user facing power off is used, so I just did the things the user sees and kept shutdown for the variables.

@sopex sopex force-pushed the shutdown-test branch from 3220165 to 6bcc51e Compare May 6, 2026 09:49
@sopex sopex force-pushed the shutdown-test branch from 6bcc51e to 0fde4b1 Compare May 6, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Add option to update and shutdown instead of restart when a restart is needed

2 participants