Why isn't my systemd service automatically starting?
Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:
[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service
[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent
[Install]
WantedBy=multi-user.target
It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:
systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)
What do I have to do to make this start up automatically on boot?
Edit
In YOCTO, the equivalent to calling systemctl enable
is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
systemd yocto
add a comment |
Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:
[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service
[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent
[Install]
WantedBy=multi-user.target
It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:
systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)
What do I have to do to make this start up automatically on boot?
Edit
In YOCTO, the equivalent to calling systemctl enable
is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
systemd yocto
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
If this is a user-supplied unit, you really want to put it in/etc/systemd/system
: the/lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your/etc/systemd/
files will override anything in/lib/systemd/
, preventing potential issues in the future.
– ErikF
May 4 '18 at 17:55
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34
add a comment |
Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:
[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service
[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent
[Install]
WantedBy=multi-user.target
It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:
systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)
What do I have to do to make this start up automatically on boot?
Edit
In YOCTO, the equivalent to calling systemctl enable
is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
systemd yocto
Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:
[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service
[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent
[Install]
WantedBy=multi-user.target
It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:
systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)
What do I have to do to make this start up automatically on boot?
Edit
In YOCTO, the equivalent to calling systemctl enable
is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
systemd yocto
systemd yocto
edited May 4 '18 at 13:04
RQDQ
asked May 4 '18 at 12:50
RQDQRQDQ
1086
1086
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
If this is a user-supplied unit, you really want to put it in/etc/systemd/system
: the/lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your/etc/systemd/
files will override anything in/lib/systemd/
, preventing potential issues in the future.
– ErikF
May 4 '18 at 17:55
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34
add a comment |
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
If this is a user-supplied unit, you really want to put it in/etc/systemd/system
: the/lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your/etc/systemd/
files will override anything in/lib/systemd/
, preventing potential issues in the future.
– ErikF
May 4 '18 at 17:55
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
If this is a user-supplied unit, you really want to put it in
/etc/systemd/system
: the /lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/
files will override anything in /lib/systemd/
, preventing potential issues in the future.– ErikF
May 4 '18 at 17:55
If this is a user-supplied unit, you really want to put it in
/etc/systemd/system
: the /lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/
files will override anything in /lib/systemd/
, preventing potential issues in the future.– ErikF
May 4 '18 at 17:55
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34
add a comment |
2 Answers
2
active
oldest
votes
You need to enable it a boot time:
systemctl enable boondocks-agent
add a comment |
In YOCTO, the equivalent to calling systemctl enable is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f441777%2fwhy-isnt-my-systemd-service-automatically-starting%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
You need to enable it a boot time:
systemctl enable boondocks-agent
add a comment |
You need to enable it a boot time:
systemctl enable boondocks-agent
add a comment |
You need to enable it a boot time:
systemctl enable boondocks-agent
You need to enable it a boot time:
systemctl enable boondocks-agent
answered May 4 '18 at 12:56
BigonBigon
1,255713
1,255713
add a comment |
add a comment |
In YOCTO, the equivalent to calling systemctl enable is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
New contributor
add a comment |
In YOCTO, the equivalent to calling systemctl enable is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
New contributor
add a comment |
In YOCTO, the equivalent to calling systemctl enable is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
New contributor
In YOCTO, the equivalent to calling systemctl enable is:
SYSTEMD_SERVICE_${PN} = "
boondocks-agent.service
"
I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
New contributor
New contributor
answered 28 mins ago
cprewitcprewit
11
11
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f441777%2fwhy-isnt-my-systemd-service-automatically-starting%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
@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.
– RQDQ
May 4 '18 at 12:54
If this is a user-supplied unit, you really want to put it in
/etc/systemd/system
: the/lib/systemd/system
directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your/etc/systemd/
files will override anything in/lib/systemd/
, preventing potential issues in the future.– ErikF
May 4 '18 at 17:55
@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.
– RQDQ
May 4 '18 at 18:24
Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.
– ErikF
May 4 '18 at 18:51
@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)
– RQDQ
May 4 '18 at 19:34