systemctl edit problem “Failed to connect to bus”
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
add a comment |
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
1
Why are you usingsudoto edit a user unit?
– muru
Feb 17 '18 at 14:17
add a comment |
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
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
systemd
edited Feb 18 '18 at 18:37
Zanna
51k13138242
51k13138242
asked Feb 17 '18 at 12:50
Stefaan VandeveldeStefaan Vandevelde
612
612
1
Why are you usingsudoto edit a user unit?
– muru
Feb 17 '18 at 14:17
add a comment |
1
Why are you usingsudoto 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
add a comment |
2 Answers
2
active
oldest
votes
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.
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 25 at 7:10
Cyril BruleboisCyril Brulebois
1
1
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Feb 25 at 9:27
pimpim
1,9291925
1,9291925
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Why are you using
sudoto edit a user unit?– muru
Feb 17 '18 at 14:17