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

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

Open
carpet92 opened this issue Aug 6, 2016 · 15 comments
Labels

Comments

@carpet92
Copy link

carpet92 commented Aug 6, 2016

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
Copy link

Leeqong commented Aug 6, 2016

the same with docker

@aseering
Copy link
Contributor

aseering commented Aug 6, 2016

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
Copy link
Contributor

aseering commented Aug 6, 2016

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
Copy link
Author

carpet92 commented Aug 6, 2016

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 #796

@aseering
Copy link
Contributor

aseering commented Aug 6, 2016

@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
Copy link
Contributor

aseering commented Aug 6, 2016

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
Copy link
Contributor

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
Copy link

etatus commented Sep 8, 2016

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

@BruceZhaoR
Copy link

BruceZhaoR commented Oct 18, 2016

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
Copy link

ghost commented Dec 29, 2016

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

@boxa72
Copy link

boxa72 commented Jan 7, 2017

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
Copy link

ipari commented Feb 17, 2017

In my case, solved with a fresh installation.

@wanderself
Copy link

same error when service nginx restart

@sunilmut
Copy link
Member

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

@maximgeerinck
Copy link

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

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

No branches or pull requests