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

Doc Idea: when you need to restart LxssManager service #634

Closed
davidnoor opened this issue Jul 6, 2016 · 9 comments

Comments

Projects
None yet
5 participants
@davidnoor
Copy link

commented Jul 6, 2016

Hey there,

First of all, I'm really impressed by this project! I do quite a bit of cross platform development; I'm a developer on a Linux-only server product with clients that support multiple platforms, and being able to work without a VM is amazing.

I just ran into an issue that might be helpful for your docs, if it's not already in there somewhere. I was trying hard to get my changes to /etc/security/limits.conf and /etc/pam.d/common-session to "take effect". I thought if I exited all of my shells and a new init would get launched, that would be similar to rebooting in Linux; but it doesn't quite seem to work that way. After a little searching I found the "LxssManager" Windows service running, and stopped and restarted it. It could be really useful to doc when that step is necessary.

@jackchammons

This comment has been minimized.

Copy link
Member

commented Jul 6, 2016

Thanks David! We love to hear that Bash on Windows is appreciated.

Closing all bash terminals will force init to be run on the open of any subsequent terminals. The service, on the other hand, will continue to run for some time after the last terminal is closed.

To check if the service is running use the following CMD command in an console:
sc query LxssManager

To restart it use:
sc stop LxssManager
Then:
sc start LxssManager

I'll check if there is a good place in the docs to put this.

@davidnoor

This comment has been minimized.

Copy link
Author

commented Jul 6, 2016

Thanks Jack! I wonder if you/your team given any thought to making shutdown/reboot from “inside” the subsystem trigger a restart of that service. Right now I believe reboot/shutdown inside bash fails. Considering a typical workflow of changing rc.d scripts and restarting to test it out, mapping reboot to a restart of that service would probably make the most sense and be the least surprising for a lot of Linux users.

-David

p.s. I live/work in Redmond, so if you guys ever do a focus group or other event, I’d love to participate.

On Jul 6, 2016, at 11:32 AM, Jack Hammons notifications@github.com wrote:

Thanks David! We love to hear that Bash on Windows is appreciated.

You are correct when you say that closing all of the open bash terminals does not necessarily stop the service.

To check if the service is running use the following CMD command in an console:
sc query LxssManager

To restart it use:
sc stop LxssManager
Then:
sc start LxssManager

I'll check if there is a good place in the docs to put this.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #634 (comment), or mute the thread https://github.com/notifications/unsubscribe/AA2f_q63kgB4A2qfrmucSFpJzA-UxkfBks5qS_TAgaJpZM4JFwf7.

@benhillis

This comment has been minimized.

Copy link
Member

commented Jul 6, 2016

@davidnoor Your original assumption that closing all of your bash.exe instances will cause a new init to be launched is correct. You should not have to restart the service. However when I say "init" I mean our private WSL init that does not touch either the /etc/security/limits.conf or /etc/pam.d/common-session file.

Could you share a specific repro of the original issue you were seeing?

@davidnoor

This comment has been minimized.

Copy link
Author

commented Jul 6, 2016

@benhillis I can go through the exact steps later this week and try to recreate it. But from my rough memory: my goal was to set the hard and softlimit for nofiles up to 8192 from the 2048 default. I had set up the linux subsystem to use user "dnoor" by default. I edited /etc/security/limits.conf and added the appropriate lines to give dnoor a hard and soft "nofile" limit of 8192, and then edited /etc/pam.d/common-session to add "session required pam-limits.so".

I closed all my bash windows, and then created a new one. ulimit -n still showed 2048. I tried this again a couple of times, and I also went to Windows task manager and made sure all the "bash" and "Init" processes were dead. I almost gave up, but then thought "I wonder if there's a windows service that acts like a cache of some things that happen when the subsystem starts up", saw the LxssManager service, and then stop/started it. I opened up a new bash window, ran ulimit -n, and it reported 8192.

@benhillis

This comment has been minimized.

Copy link
Member

commented Jul 8, 2016

@davidnoor - I suspect something else you're running is using the setrlimit system call to set these values. I checked the source of our init process and it doesn't do this so it must be something else you're running.

@davidnoor

This comment has been minimized.

Copy link
Author

commented Jul 8, 2016

Ok, fascinating. I’ll try to repro with a “clean” environment when I get a chance.

-David

On Jul 8, 2016, at 10:12 AM, Ben Hillis notifications@github.com wrote:

@davidnoor https://github.com/davidnoor - I suspect something else you're running is using the setrlimit system call to set these values. I checked the source of our init process and it doesn't do this so it must be something else you're running.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #634 (comment), or mute the thread https://github.com/notifications/unsubscribe/AA2f_iz_h1y7kzdUCWmUR7GUlQiBJqMAks5qToT-gaJpZM4JFwf7.

@benhillis

This comment has been minimized.

Copy link
Member

commented Jul 8, 2016

@davidnoor Thanks!

@kdbotts

This comment has been minimized.

Copy link

commented Oct 19, 2017

I am a long time (20 years) Cygwin user. I am extremely fluent under Unix, Linux and Windows. I intend to keep Cygwin, but I thought I would try out WSL. I installed it on Win10FallCreatorsLatest1709. Immediately, when I start a Cygwin bash, it has my WSL home dir, instead of what I use as my Cygwin home dir. I have the HOME envar pointed to my cygwin home dir. Even in the crippled Cygwin bash (crippled, because it did not start in the right home dir, and did not run .profile or .bashrc or anything) the HOME envar still has the value of my Cygwin home dir. Apparently, somehow, WSL is making even a Cygwin bash start in the wrong home dir. I think it also masks other things, like, the WSL /etc in place of the Cygwin /etc. I do not know what all. I managed to uninstall WSL, and things are back to normal now. I am doing all this on a VM clone of another machine, so I can blow it away if necessary, and will if WSL or anything else messes up my Cygwin. I would like to have WSL, for optional-occasional use, because I am about to start using DockerForWindows in HyperV mode, and stuff like that. I would like, for instance, to be able to run native Linux Docker, as well as DockerForWindows, on the same host, but I understand that running Docker of any kind under Cygwin will not work. The upshot is: Is it possible to use Cygwin and WSL side by side on the same Win10 host? Has anybody else tried to do this? And what the heck is WSL doing to intercept the normal behavior of any Linux-like thing, which is, start a login shell in the value of the HOME envar?

Reply

@therealkenc

This comment has been minimized.

Copy link
Collaborator

commented May 25, 2018

This one died strangely with "I’ll try to repro with a “clean” environment when I get a chance".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.