-
Notifications
You must be signed in to change notification settings - Fork 821
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
Clean shutdown of Linux from Windows? #5661
Comments
I read some of those posts myself, the last one specifically, but the terminate command is not much different from shutdown, in terms of giving systemctl any notice. I started up the samba daemon, did
Compare that to
There is a whole lot of user-level jobs that is left out by letting WSL shut it down, I think the big red power switch applies to all of its commands. I know my question about Windows shutdown scripts is a bit off-topic, but the MS forums can get a bit dizzying. If someone knows how to automate the command poweroff at Windows shutdown that would be a good solution. |
You are right, it isn't. If you've spun your own Having |
@therealkenc |
Alright. I am going to drop the feature tag, because the ask really is /dupe #994, or more generally, support for third-party |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
@psisis Just a quick note - I saw this issue and added shutdown support (using (Disclaimer: It is not, principally for mount reasons, perfectly idempotent, and so I wouldn't recommend starting a new genie bottle (or indeed, carrying on using Linux) without terminating and restarting the distro in question first.) |
I seem to have issues with initiating a clean shutdown of the WSL system without needing to issue it from within. For example, I run the genie program that emulates systemd. I have services that mount certain filesystems and I want to unmount them cleanly before shutdown. The command
wsl.exe --shutdown
does not give Linux time to stop services, in journalctl it looks like the worst kind of shutdown, it just gets blank. From cmd I can dowsl.exe sudo systemctl stop srv
&&
wsl.exe sudo systemctl poweroff
but I’m trying to automate this behavior. I have tried a Windows shutdown script by policies, where I enter the commands above along with a timeout of 3s, but it does not work. How do I even know if the script is executed? Event viewer does not give me clues, and I have enabled verbose status messages. Is there no native WSL support for clean shutdowns? Thanks for any help.The text was updated successfully, but these errors were encountered: