microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.37k stars 816 forks source link

Windows Linux Subsystem. initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused #791

Open carpet92 opened 8 years ago

carpet92 commented 8 years ago

I install MongoDB in Linux Subsystem with

sudo apt-get install mongodb

and when I try to start it with sudo service mongodb start I have the following error

User@DESKTOP-TPQIRNP:/mnt/c/Users/User$ sudo service mongodb status
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
 * Checking status of database mongodb                                                                 [ OK ]

MongoDB really starts but what is this message/error initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused and how to fix it? Have a official solution to this problem?

I reset my Windows 10 Pro x64 three days ago (on clean HDD). At the moment in Settings -> Update & Security not offered any updates to fix

Leeqong commented 8 years ago

the same with docker

aseering commented 8 years ago

Hi @Zx-EvM -- this error can be safely ignored. WSL doesn't use Upstart to start processes at system boot. If you work closely with Upstart, this might cause some surprises for you; the message is informative to people who work directly with initctl, upstart, etc that WSL doesn't yet expose that functionality. If that's not your use case, then as you have observed, mongodb itself works.

Incidentally, just a heads-up for you / to set expectations: WSL is beta software in this release. Some companies of late have had "beta" releases that are really production-ready. But WSL really is traditional beta software: There are many things that it does correctly; there are also many things that are still in progress so don't work yet. It's typical to hit messages such as this one, or to encounter tools that don't completely work yet, etc. Feel free to look through the tickets filed in this bug-tracker; you'll quickly get a sense of the state of the Bash-on-Ubuntu-on-Windows feature.

If you're comfortable with that, cool! It's great to have another beta user, and to know about this error message. If this error message is causing any actual problems for you, or if you have any trouble using mongodb or other tools, folks here would be glad to help. If you do, please fill out the template that comes with the ticket; that information is needed to help identify what underlying kernel features might be misbehaving or not yet implemented.

aseering commented 8 years ago

Hi @Leeqong -- Docker is actually a separate/existing issue (and a more complicated one) -- unlike mongodb, it doesn't start at all), and is tracked by #85 . There's a bunch of discussion on that ticket; feel free to read it for background.

carpet92 commented 8 years ago

Hi @aseering thanks. That is, there is a likelihood that this (and other) errors will be corrected in some time?

or if you have any trouble using mongodb or other tools, folks here would be glad to help

I really have only one error with install MongoDB in Windows Linux Subsystem here https://github.com/Microsoft/BashOnWindows/issues/796

aseering commented 8 years ago

@Zx-EvM -- errors are definitely being corrected in general; they typically stage a batch of fixes once every week or two. You may need to join the Windows Insider Fast Ring ([EDIT] in the "Windows Insider Program" section inside Settings) in order to get them more quickly, though Microsoft hasn't yet really explained how updates are going to look after the recent Anniversary Update release. (Note that the Fast Ring is a pre-release version of all of Windows, so you may find bugs in things other than WSL.)

This particular message isn't preventing anyone from using mongodb, and fixing Upstart support is conceptually hard (it handles Linux's boot process but WSL doesn't need to boot), and Upstart itself is deprecated and will go away entirely if/when WSL updates to be based on Ubuntu 16.04. (It'll be replaced by systemd, which is even more complicated :-) ) I don't work at Microsoft myself (I'm just a user), but if I had to guess, I'd say that other bigger blockers and easier-to-fix errors are probably higher on their priority list.

aseering commented 8 years ago

Incidentally, if you think this particular failure should be higher priority, the way to make that happen is to file it here and find people who care about it and get them to vote for it.

aseering commented 8 years ago

Incidentally, if anyone reading this wants a workaround for getting these sorts of init scripts running at Windows system boot, I've posted a comment here that explains how to do so:

http://wsl-forum.qztc.io/viewtopic.php?f=6&t=10

etatus commented 8 years ago

There is a workaround here for the Upstart issue: https://www.nesono.com/node/368

BruceZhaoR commented 8 years ago

Same situation when running Shiny Server, but I figured out, Thanks to @etatus

Shiny Server is a server program from RStudio, Inc. that makes Shiny applications available over the web. Shiny is a web application framework for the R statistical computation language.

reproducible example and reference :

sudo apt-get install r-base
sudo R -e "install.packages(c('shiny', rmarkdown'), repos = 'https://cran.rstudio.com/')"
sudo apt-get install gdebi-core
wget https://download3.rstudio.org/ubuntu-12.04/x86_64/shiny-server-1.4.7.815-amd64.deb
sudo gdebi shiny-server-1.4.7.815-amd64.deb
sudo dpkg-divert --local --rename --add /sbin/initctl
sudo ln -s /bin/true /sbin/initctl

please cc @Zx-EvM

And reference : https://www.rstudio.com/products/shiny/download-server/ https://www.nesono.com/node/368

ghost commented 7 years ago

Same error when apt-get purge openssh-server -y in a fresh installation.

boxa72 commented 7 years ago

This is a very good article on the change from upstart to systemd that explains pretty much everything https://wiki.ubuntu.com/SystemdForUpstartUsers#Common_Problems

ipari commented 7 years ago

In my case, solved with a fresh installation.

wanderself commented 7 years ago

same error when service nginx restart

sunilmut commented 7 years ago

@wanderself - upstart service is currently not available on WSL. Alternatively, you can start the service by sudo /etc/init.d/nginx start.

maximgeerinck commented 7 years ago

For me this did the trick:

cat > /usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF
chmod +x /usr/sbin/policy-rc.d
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

source

Since i was using docker i also found this one really useful: https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/ Which allows you to only have your containers stored on your main docker system rather than on both