-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reboot computer if installer returns a reboot code #25
Comments
@DamianBis 0.9.10 (in beta for a tiny bit longer) will return the exit codes from the packages - chocolatey/choco#512. This can be the queue to reboot. 👍 |
@lawrencegripper @ebekker I noticed this doesn't trigger the DSC "reboot requested" code logic. Is there somewhere in the code we could set the flag "$global:DSCMachineStatus = 1" which will allow DSC to reboot the machine itself if the client config "RebootNodeIfNeeded = $true" is set? See the notes about setting it via another resource here, https://powershell.org/forums/topic/handling-reboots-in-dsc/ |
Can someone provide an example package that requires reboots, if so I'll work on fixing this. |
One of the .NET 4.x packages, likely 4.5.2 or 4.6 require reboots. |
@javydekoning Have you had a chance to take a look at this? I'm using Azure Automation DSC so I've got the global "Reboot if necessary" set, but it would be handy to properly trigger that from cChoco as well. |
@dragon788 not really, sorry. It seems hard to get contributors for this resource, and I'm lacking the spare time to drive this project alone. |
Picking this up with @dragon788. |
This one requires reboot, I think https://chocolatey.org/packages/kb2919355 |
Any further update on this? I'm currently developing a package that has "vcredist140" as a prereq. On the Choco test environment, this also installs some windows updates that require a reboot. after vcredist140 is installed i cant progress the install of my package as a reboot is pending. |
As a workaround, you can use the PendingReboot resource from ComputerManagementDsc to look at the registry and reboot if there is one pending. |
The purpose of this resource is not to reboot the computer itself. I just wanted to clear that up. If the computer installs a package that requires a reboot then Chocolatey will flag that with an exit code. It would then be down to the code to take that and do with it as needed and what @kevinpohlmeier has suggested seems to fit that bill. Boxstarter (GitHub repo) will install packages and reboot when needed, logging back in and continuing. |
As there hasn't been any real update to this in some time, the requirement is now implemented in Chocolatey and the comments above, my intention would be to close this. I will leave it open for a little while for any further comments, though. |
how to exit reboot? give example command. |
@zarulyakuza This issue is closed. Please reach out on our Community Chat with any questions. |
Reopened after request over on Discord. |
Some packages won't install properly without a reboot. Chocolatey never reboots the PC. from my recollection there was a return code that advises that a reboot is required @ferventcoder can probably confirm?.
This resource would benefit if we can add a variable "SupressReboot" into the cChocoPackageInstall which if it's FALSE the DSC config will set the global variable for a reboot required.. DSC would then either reboot or not reboot based on your individual configuration.
The text was updated successfully, but these errors were encountered: