systemctl edit problem “Failed to connect to bus” The Next CEO of Stack OverflowFailed to get D-BUS connection (systemctl, pulse) after upgrade to 15.04How to reproduce “systemctl EDIT” behavior in Ubuntu LTSsystemctl, how to unmasksystemctl failed to connect to bus - docker ubuntu:16.04 containerInterpretting systemctl status outputsytemctl --user start results in “Failed to connect to bus: no such file or directory”systemctl status not showing CPU/Memory usage?systemctl failed to execute because it isnt a directoryUnable to use systemctlBoot time takes more than 5 minutes after moving partitions in Ubuntu 18.04

What does this strange code stamp on my passport mean?

Does Germany produce more waste than the US?

What difference does it make matching a word with/without a trailing whitespace?

Salesforce opportunity stages

Compensation for working overtime on Saturdays

Oldie but Goldie

What happens if you break a law in another country outside of that country?

Planeswalker Ability and Death Timing

What is the difference between 'contrib' and 'non-free' packages repositories?

Can Sri Krishna be called 'a person'?

Avoiding the "not like other girls" trope?

Is it a bad idea to plug the other end of ESD strap to wall ground?

My boss doesn't want me to have a side project

Is a distribution that is normal, but highly skewed, considered Gaussian?

How to unfasten electrical subpanel attached with ramset

Gauss' Posthumous Publications?

"Eavesdropping" vs "Listen in on"

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Why did the Drakh emissary look so blurred in S04:E11 "Lines of Communication"?

Shortening a title without changing its meaning

How do I secure a TV wall mount?

How to find if SQL server backup is encrypted with TDE without restoring the backup

How can I separate the number from the unit in argument?

Calculating discount not working



systemctl edit problem “Failed to connect to bus”



The Next CEO of Stack OverflowFailed to get D-BUS connection (systemctl, pulse) after upgrade to 15.04How to reproduce “systemctl EDIT” behavior in Ubuntu LTSsystemctl, how to unmasksystemctl failed to connect to bus - docker ubuntu:16.04 containerInterpretting systemctl status outputsytemctl --user start results in “Failed to connect to bus: no such file or directory”systemctl status not showing CPU/Memory usage?systemctl failed to execute because it isnt a directoryUnable to use systemctlBoot time takes more than 5 minutes after moving partitions in Ubuntu 18.04










2















When I attempt to create a new systemd unit (on Ubuntu 16.04)



$ sudo systemctl edit --user --full --force wagoOpenhabBridge.service
Failed to connect to bus: No such file or directory


Apart from this problem my systemd is running fine.

After some internet research, I checked these things:



  • I'm not using docker, Ubuntu is running directly on Intel NUC x64 hardware

  • systemd is running with PID=1


  • XDG variables in env are



    XDGSESSIONID=1790 
    XDGDATADIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
    XDGRUNTIMEDIR=/run/user/1000


Any ideas what is going wrong? What other things can I check?










share|improve this question
















bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    Why are you using sudo to edit a user unit?

    – muru
    Feb 17 '18 at 14:17















2















When I attempt to create a new systemd unit (on Ubuntu 16.04)



$ sudo systemctl edit --user --full --force wagoOpenhabBridge.service
Failed to connect to bus: No such file or directory


Apart from this problem my systemd is running fine.

After some internet research, I checked these things:



  • I'm not using docker, Ubuntu is running directly on Intel NUC x64 hardware

  • systemd is running with PID=1


  • XDG variables in env are



    XDGSESSIONID=1790 
    XDGDATADIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
    XDGRUNTIMEDIR=/run/user/1000


Any ideas what is going wrong? What other things can I check?










share|improve this question
















bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    Why are you using sudo to edit a user unit?

    – muru
    Feb 17 '18 at 14:17













2












2








2








When I attempt to create a new systemd unit (on Ubuntu 16.04)



$ sudo systemctl edit --user --full --force wagoOpenhabBridge.service
Failed to connect to bus: No such file or directory


Apart from this problem my systemd is running fine.

After some internet research, I checked these things:



  • I'm not using docker, Ubuntu is running directly on Intel NUC x64 hardware

  • systemd is running with PID=1


  • XDG variables in env are



    XDGSESSIONID=1790 
    XDGDATADIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
    XDGRUNTIMEDIR=/run/user/1000


Any ideas what is going wrong? What other things can I check?










share|improve this question
















When I attempt to create a new systemd unit (on Ubuntu 16.04)



$ sudo systemctl edit --user --full --force wagoOpenhabBridge.service
Failed to connect to bus: No such file or directory


Apart from this problem my systemd is running fine.

After some internet research, I checked these things:



  • I'm not using docker, Ubuntu is running directly on Intel NUC x64 hardware

  • systemd is running with PID=1


  • XDG variables in env are



    XDGSESSIONID=1790 
    XDGDATADIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
    XDGRUNTIMEDIR=/run/user/1000


Any ideas what is going wrong? What other things can I check?







systemd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 18 '18 at 18:37









Zanna

51.2k13139242




51.2k13139242










asked Feb 17 '18 at 12:50









Stefaan VandeveldeStefaan Vandevelde

1112




1112





bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









  • 1





    Why are you using sudo to edit a user unit?

    – muru
    Feb 17 '18 at 14:17












  • 1





    Why are you using sudo to edit a user unit?

    – muru
    Feb 17 '18 at 14:17







1




1





Why are you using sudo to edit a user unit?

– muru
Feb 17 '18 at 14:17





Why are you using sudo to edit a user unit?

– muru
Feb 17 '18 at 14:17










2 Answers
2






active

oldest

votes


















0














Is the dbus package installed?



I've noticed a similar issue when running systemctl show $UNIT as a user, with a connection attempted on /var/run/dbus/system_bus_socket which only exists if dbus-daemon --system is running, which itself needs the dbus package to be installed.



You can investigate further by using strace to check what syscalls are performed, and determine which exact issues this Failed to connect to bus: No such file or directory is about. Even if not trying to access the system bus, it's likely to be D-Bus related.



Your systemd package might have dbus in Recommends (that's the case in Debian 9 at least); checking those is usually a good idea when something doesn't work as expected.






share|improve this answer






























    0














    I just came across a similar problem, it was caused by trying to run a service as a user I was not logged in with (this user has login disable, and I was using su and sg to fake it).



    Why sudo ?



    You have probably added sudo because the command was not working, you can safely remove it. A user systemd service is a regular file owned by the regular user.



    Fixing Failed to connect to bus: No such file or directory



    I found the solution on stackexchange, the DBUS_SESSION_BUS_ADDRESS seems to be missing from your environment.



    Your command can be run as this:



    export XDG_RUNTIME_DIR="/run/user/$UID"
    export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
    systemctl edit --user --full --force wagoOpenhabBridge.service


    Running the command before login



    If you want the service to be started before the user login, don't forget to run:



    sudo loginctl enable-linger USERNAME





    share|improve this answer























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "89"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007055%2fsystemctl-edit-problem-failed-to-connect-to-bus%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Is the dbus package installed?



      I've noticed a similar issue when running systemctl show $UNIT as a user, with a connection attempted on /var/run/dbus/system_bus_socket which only exists if dbus-daemon --system is running, which itself needs the dbus package to be installed.



      You can investigate further by using strace to check what syscalls are performed, and determine which exact issues this Failed to connect to bus: No such file or directory is about. Even if not trying to access the system bus, it's likely to be D-Bus related.



      Your systemd package might have dbus in Recommends (that's the case in Debian 9 at least); checking those is usually a good idea when something doesn't work as expected.






      share|improve this answer



























        0














        Is the dbus package installed?



        I've noticed a similar issue when running systemctl show $UNIT as a user, with a connection attempted on /var/run/dbus/system_bus_socket which only exists if dbus-daemon --system is running, which itself needs the dbus package to be installed.



        You can investigate further by using strace to check what syscalls are performed, and determine which exact issues this Failed to connect to bus: No such file or directory is about. Even if not trying to access the system bus, it's likely to be D-Bus related.



        Your systemd package might have dbus in Recommends (that's the case in Debian 9 at least); checking those is usually a good idea when something doesn't work as expected.






        share|improve this answer

























          0












          0








          0







          Is the dbus package installed?



          I've noticed a similar issue when running systemctl show $UNIT as a user, with a connection attempted on /var/run/dbus/system_bus_socket which only exists if dbus-daemon --system is running, which itself needs the dbus package to be installed.



          You can investigate further by using strace to check what syscalls are performed, and determine which exact issues this Failed to connect to bus: No such file or directory is about. Even if not trying to access the system bus, it's likely to be D-Bus related.



          Your systemd package might have dbus in Recommends (that's the case in Debian 9 at least); checking those is usually a good idea when something doesn't work as expected.






          share|improve this answer













          Is the dbus package installed?



          I've noticed a similar issue when running systemctl show $UNIT as a user, with a connection attempted on /var/run/dbus/system_bus_socket which only exists if dbus-daemon --system is running, which itself needs the dbus package to be installed.



          You can investigate further by using strace to check what syscalls are performed, and determine which exact issues this Failed to connect to bus: No such file or directory is about. Even if not trying to access the system bus, it's likely to be D-Bus related.



          Your systemd package might have dbus in Recommends (that's the case in Debian 9 at least); checking those is usually a good idea when something doesn't work as expected.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 25 at 7:10









          Cyril BruleboisCyril Brulebois

          1




          1























              0














              I just came across a similar problem, it was caused by trying to run a service as a user I was not logged in with (this user has login disable, and I was using su and sg to fake it).



              Why sudo ?



              You have probably added sudo because the command was not working, you can safely remove it. A user systemd service is a regular file owned by the regular user.



              Fixing Failed to connect to bus: No such file or directory



              I found the solution on stackexchange, the DBUS_SESSION_BUS_ADDRESS seems to be missing from your environment.



              Your command can be run as this:



              export XDG_RUNTIME_DIR="/run/user/$UID"
              export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
              systemctl edit --user --full --force wagoOpenhabBridge.service


              Running the command before login



              If you want the service to be started before the user login, don't forget to run:



              sudo loginctl enable-linger USERNAME





              share|improve this answer



























                0














                I just came across a similar problem, it was caused by trying to run a service as a user I was not logged in with (this user has login disable, and I was using su and sg to fake it).



                Why sudo ?



                You have probably added sudo because the command was not working, you can safely remove it. A user systemd service is a regular file owned by the regular user.



                Fixing Failed to connect to bus: No such file or directory



                I found the solution on stackexchange, the DBUS_SESSION_BUS_ADDRESS seems to be missing from your environment.



                Your command can be run as this:



                export XDG_RUNTIME_DIR="/run/user/$UID"
                export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
                systemctl edit --user --full --force wagoOpenhabBridge.service


                Running the command before login



                If you want the service to be started before the user login, don't forget to run:



                sudo loginctl enable-linger USERNAME





                share|improve this answer

























                  0












                  0








                  0







                  I just came across a similar problem, it was caused by trying to run a service as a user I was not logged in with (this user has login disable, and I was using su and sg to fake it).



                  Why sudo ?



                  You have probably added sudo because the command was not working, you can safely remove it. A user systemd service is a regular file owned by the regular user.



                  Fixing Failed to connect to bus: No such file or directory



                  I found the solution on stackexchange, the DBUS_SESSION_BUS_ADDRESS seems to be missing from your environment.



                  Your command can be run as this:



                  export XDG_RUNTIME_DIR="/run/user/$UID"
                  export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
                  systemctl edit --user --full --force wagoOpenhabBridge.service


                  Running the command before login



                  If you want the service to be started before the user login, don't forget to run:



                  sudo loginctl enable-linger USERNAME





                  share|improve this answer













                  I just came across a similar problem, it was caused by trying to run a service as a user I was not logged in with (this user has login disable, and I was using su and sg to fake it).



                  Why sudo ?



                  You have probably added sudo because the command was not working, you can safely remove it. A user systemd service is a regular file owned by the regular user.



                  Fixing Failed to connect to bus: No such file or directory



                  I found the solution on stackexchange, the DBUS_SESSION_BUS_ADDRESS seems to be missing from your environment.



                  Your command can be run as this:



                  export XDG_RUNTIME_DIR="/run/user/$UID"
                  export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
                  systemctl edit --user --full --force wagoOpenhabBridge.service


                  Running the command before login



                  If you want the service to be started before the user login, don't forget to run:



                  sudo loginctl enable-linger USERNAME






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 25 at 9:27









                  pimpim

                  1,9391925




                  1,9391925



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007055%2fsystemctl-edit-problem-failed-to-connect-to-bus%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

                      Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

                      Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»