Skip to content

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

Open

Description

@carpet92

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

Activity

  1. Leeqong commented on Aug 6, 2016

    @Leeqong

    the same with docker

  2. aseering commented on Aug 6, 2016

    @aseering
    Contributor

    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.

  3. aseering commented on Aug 6, 2016

    @aseering
    Contributor

    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.

  4. carpet92 commented on Aug 6, 2016

    @carpet92
    Author

    Hi Adam Seering (@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

  5. aseering commented on Aug 6, 2016

    @aseering
    Contributor

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

  6. aseering commented on Aug 6, 2016

    @aseering
    Contributor

    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.

  7. aseering commented on Aug 10, 2016

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

  8. etatus commented on Sep 8, 2016

    @etatus
  9. BruceZhaoR commented on Oct 18, 2016

    @BruceZhaoR

    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

  10. boxa72 commented on Jan 7, 2017

    @boxa72

    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

  11. ipari commented on Feb 17, 2017

    @ipari

    In my case, solved with a fresh installation.

  12. wanderself commented on Jul 29, 2017

    @wanderself

    same error when service nginx restart

  13. sunilmut commented on Jul 31, 2017

    @sunilmut
    Member

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

  14. maximgeerinck commented on Sep 11, 2017

    @maximgeerinck

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions