systemctl edit problem “Failed to connect to bus” The Next CEO of Stack OverflowFailed to...

Does Germany produce more waste than the US?

Oldie but Goldie

Gauss' Posthumous Publications?

How do I secure a TV wall mount?

A hang glider, sudden unexpected lift to 25,000 feet altitude, what could do this?

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

"Eavesdropping" vs "Listen in on"

Can you teleport closer to a creature you are Frightened of?

What does this strange code stamp on my passport mean?

Is it correct to say moon starry nights?

How should I connect my cat5 cable to connectors having an orange-green line?

Is it possible to make a 9x9 table fit within the default margins?

How to unfasten electrical subpanel attached with ramset

Read/write a pipe-delimited file line by line with some simple text manipulation

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

Can Sri Krishna be called 'a person'?

Are British MPs missing the point, with these 'Indicative Votes'?

That's an odd coin - I wonder why

Incomplete cube

Finitely generated matrix groups whose eigenvalues are all algebraic

Why can't we say "I have been having a dog"?

Calculating discount not working

Cannot restore registry to default in Windows 10?

Find a path from s to t using as few red nodes as possible



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 23 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 23 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 23 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 23 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

                      Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                      Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                      Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...