Skip to content
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

Open
DamianBis opened this issue May 27, 2016 · 15 comments · May be fixed by #184
Open

Reboot computer if installer returns a reboot code #25

DamianBis opened this issue May 27, 2016 · 15 comments · May be fixed by #184

Comments

@DamianBis
Copy link
Contributor

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.

@ferventcoder
Copy link
Member

@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. 👍

@dragon788
Copy link

dragon788 commented Aug 16, 2016

@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/

@javydekoning
Copy link
Contributor

Can someone provide an example package that requires reboots, if so I'll work on fixing this.

@ferventcoder
Copy link
Member

ferventcoder commented Oct 10, 2016

One of the .NET 4.x packages, likely 4.5.2 or 4.6 require reboots.

@dragon788
Copy link

@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.

@javydekoning
Copy link
Contributor

@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.

@ferventcoder
Copy link
Member

Picking this up with @dragon788.

@mloskot
Copy link

mloskot commented Sep 14, 2017

This one requires reboot, I think https://chocolatey.org/packages/kb2919355

@andyfisher100
Copy link

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.

@kevinpohlmeier
Copy link

As a workaround, you can use the PendingReboot resource from ComputerManagementDsc to look at the registry and reboot if there is one pending.

@pauby
Copy link
Member

pauby commented Jan 22, 2021

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.

@pauby
Copy link
Member

pauby commented Jan 22, 2021

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.

@zarulyakuza
Copy link

how to exit reboot? give example command.

@chocolatey chocolatey locked as resolved and limited conversation to collaborators Feb 16, 2023
@pauby
Copy link
Member

pauby commented Feb 16, 2023

@zarulyakuza This issue is closed. Please reach out on our Community Chat with any questions.

@pauby pauby reopened this May 14, 2024
@pauby
Copy link
Member

pauby commented May 14, 2024

Reopened after request over on Discord.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants