systemctl --failed not listing failed instantiated serviceMigrate socat init script to systemdWhy is my...
Isn't the detector always measuring, and thus always collapsing the state?
How to protect bash function from being overridden?
Parent asking for money after I moved out
Does publication of the phone call ruin the basis for impeachment?
Young adult short story book with one story where a woman finds a walrus suit and becomes a walrus
Sci-fi story about aliens with cells based on arsenic or nitrogen, poisoned by oxygen
Citing CPLEX 12.9
Search for something difficult to count/estimate
Generating numbers with cubes
Check if number is in list of numbers
Why does the Pilatus PC-24 have such a large "Wing Support"?
Canteen Cutlery Issue
Writing about real people - not giving offence
Found a minor bug, affecting 1% of users. What should QA do?
What does a textbook look like while you are writing it?
Is the "spacetime" the same thing as the mathematical 4th dimension?
Why do popular TCP-using services have UDP as well as TCP entries in /etc/services?
Does Hogwarts have its own anthem?
How can I find places to store/land a private airplane?
Does the US Armed Forces refuse to recruit anyone with an IQ less than 83?
Does using a crossbow with the Sharpshooter feat change its range in underwater combat?
Is there an in-universe explanation of how Frodo's arrival in Valinor was recorded in the Red Book?
Single tx included in two different blocks
What is the Japanese equivalent of 'you're in my heart'?
systemctl --failed not listing failed instantiated service
Migrate socat init script to systemdWhy is my Systemd unit loaded, but inactive (dead)?mysql service restarted during user being connected lead to failing serviceWhy x0vncserver is not starting at boot?Why is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxsystemctl - service exit codes and status information explanation
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
I have successfully created and configured a systemd template for easily spawning instances of similar services.
the template looks like this:
[Unit]
Description=my awesome service %I
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/binary -c /path/to/config/%i.conf
ExecStop=/usr/bin/pkill --full %i
Restart=on-failure
User=root
Group=root
TimeoutSec=30
[Install]
WantedBy=multi-user.target
I enabled and started the instance with systemcl enable name@kkk, systemctl start name@kkk and did not create a /path/to/config/kkk.conf file, so the service fails:
~# systemctl status name@kkk.service
● name@kkk.service - my awesome service kkk
Loaded: loaded (/etc/systemd/system/name@.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
Process: 30116 ExecStop=/usr/bin/pkill --full %i (code=exited, status=1/FAILURE)
Process: 30113 ExecStart=/usr/local/bin/binary -c /path/to/config/kkk.conf (code=exited, status=1/FA
Main PID: 30113 (code=exited, status=1/FAILURE)
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Unit entered failed state.
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Failed with result 'exit-code'.
Oct 04 15:20:09 host systemd[1]: name@kkk.service: Service hold-off time over, scheduling restart.
Oct 04 15:20:09 host systemd[1]: Stopped my awesome service for kkk.
If I run systemctl --failed, I get
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
which is obviously not correct, because the service is failed. Am I doing something wrong or missing something here? TIA.
systemd
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment
|
I have successfully created and configured a systemd template for easily spawning instances of similar services.
the template looks like this:
[Unit]
Description=my awesome service %I
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/binary -c /path/to/config/%i.conf
ExecStop=/usr/bin/pkill --full %i
Restart=on-failure
User=root
Group=root
TimeoutSec=30
[Install]
WantedBy=multi-user.target
I enabled and started the instance with systemcl enable name@kkk, systemctl start name@kkk and did not create a /path/to/config/kkk.conf file, so the service fails:
~# systemctl status name@kkk.service
● name@kkk.service - my awesome service kkk
Loaded: loaded (/etc/systemd/system/name@.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
Process: 30116 ExecStop=/usr/bin/pkill --full %i (code=exited, status=1/FAILURE)
Process: 30113 ExecStart=/usr/local/bin/binary -c /path/to/config/kkk.conf (code=exited, status=1/FA
Main PID: 30113 (code=exited, status=1/FAILURE)
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Unit entered failed state.
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Failed with result 'exit-code'.
Oct 04 15:20:09 host systemd[1]: name@kkk.service: Service hold-off time over, scheduling restart.
Oct 04 15:20:09 host systemd[1]: Stopped my awesome service for kkk.
If I run systemctl --failed, I get
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
which is obviously not correct, because the service is failed. Am I doing something wrong or missing something here? TIA.
systemd
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57
add a comment
|
I have successfully created and configured a systemd template for easily spawning instances of similar services.
the template looks like this:
[Unit]
Description=my awesome service %I
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/binary -c /path/to/config/%i.conf
ExecStop=/usr/bin/pkill --full %i
Restart=on-failure
User=root
Group=root
TimeoutSec=30
[Install]
WantedBy=multi-user.target
I enabled and started the instance with systemcl enable name@kkk, systemctl start name@kkk and did not create a /path/to/config/kkk.conf file, so the service fails:
~# systemctl status name@kkk.service
● name@kkk.service - my awesome service kkk
Loaded: loaded (/etc/systemd/system/name@.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
Process: 30116 ExecStop=/usr/bin/pkill --full %i (code=exited, status=1/FAILURE)
Process: 30113 ExecStart=/usr/local/bin/binary -c /path/to/config/kkk.conf (code=exited, status=1/FA
Main PID: 30113 (code=exited, status=1/FAILURE)
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Unit entered failed state.
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Failed with result 'exit-code'.
Oct 04 15:20:09 host systemd[1]: name@kkk.service: Service hold-off time over, scheduling restart.
Oct 04 15:20:09 host systemd[1]: Stopped my awesome service for kkk.
If I run systemctl --failed, I get
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
which is obviously not correct, because the service is failed. Am I doing something wrong or missing something here? TIA.
systemd
I have successfully created and configured a systemd template for easily spawning instances of similar services.
the template looks like this:
[Unit]
Description=my awesome service %I
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/binary -c /path/to/config/%i.conf
ExecStop=/usr/bin/pkill --full %i
Restart=on-failure
User=root
Group=root
TimeoutSec=30
[Install]
WantedBy=multi-user.target
I enabled and started the instance with systemcl enable name@kkk, systemctl start name@kkk and did not create a /path/to/config/kkk.conf file, so the service fails:
~# systemctl status name@kkk.service
● name@kkk.service - my awesome service kkk
Loaded: loaded (/etc/systemd/system/name@.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
Process: 30116 ExecStop=/usr/bin/pkill --full %i (code=exited, status=1/FAILURE)
Process: 30113 ExecStart=/usr/local/bin/binary -c /path/to/config/kkk.conf (code=exited, status=1/FA
Main PID: 30113 (code=exited, status=1/FAILURE)
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Unit entered failed state.
Oct 04 15:20:08 host systemd[1]: name@kkk.service: Failed with result 'exit-code'.
Oct 04 15:20:09 host systemd[1]: name@kkk.service: Service hold-off time over, scheduling restart.
Oct 04 15:20:09 host systemd[1]: Stopped my awesome service for kkk.
If I run systemctl --failed, I get
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
which is obviously not correct, because the service is failed. Am I doing something wrong or missing something here? TIA.
systemd
systemd
asked Oct 4 '17 at 13:48
natxo asenjonatxo asenjo
3502 silver badges4 bronze badges
3502 silver badges4 bronze badges
bumped to the homepage by Community♦ 1 hour 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♦ 1 hour 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♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57
add a comment
|
1
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57
1
1
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57
add a comment
|
2 Answers
2
active
oldest
votes
The service is not in a failed state. As you can see here :
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
It is inactive (dead)
. If it was failed you would get something like this :
Active: failed (Result: exit-code)
To see both failed and inactive services you should use the command :
systemctl --failed --all
add a comment
|
This is a bug in systemd, where a service which fails all of its restarts gets listed as "inactive" rather than "failed". In my testing it occurs in 229 (default with Ubuntu Xenial), and is fixed in 238; maybe some changelog snooping will reveal which version fixed it.
The best workaround seems to be to remove Restart
from your service file and manually handle restarting yourself.
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/4.0/"u003ecc by-sa 4.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%2f396075%2fsystemctl-failed-not-listing-failed-instantiated-service%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
The service is not in a failed state. As you can see here :
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
It is inactive (dead)
. If it was failed you would get something like this :
Active: failed (Result: exit-code)
To see both failed and inactive services you should use the command :
systemctl --failed --all
add a comment
|
The service is not in a failed state. As you can see here :
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
It is inactive (dead)
. If it was failed you would get something like this :
Active: failed (Result: exit-code)
To see both failed and inactive services you should use the command :
systemctl --failed --all
add a comment
|
The service is not in a failed state. As you can see here :
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
It is inactive (dead)
. If it was failed you would get something like this :
Active: failed (Result: exit-code)
To see both failed and inactive services you should use the command :
systemctl --failed --all
The service is not in a failed state. As you can see here :
Active: inactive (dead) (Result: exit-code) since Wed 2017-10-04 15:20:09 CEST; 3min 27s ago
It is inactive (dead)
. If it was failed you would get something like this :
Active: failed (Result: exit-code)
To see both failed and inactive services you should use the command :
systemctl --failed --all
edited Oct 4 '17 at 14:24
answered Oct 4 '17 at 14:00
Hunter.S.ThompsonHunter.S.Thompson
6,0165 gold badges15 silver badges36 bronze badges
6,0165 gold badges15 silver badges36 bronze badges
add a comment
|
add a comment
|
This is a bug in systemd, where a service which fails all of its restarts gets listed as "inactive" rather than "failed". In my testing it occurs in 229 (default with Ubuntu Xenial), and is fixed in 238; maybe some changelog snooping will reveal which version fixed it.
The best workaround seems to be to remove Restart
from your service file and manually handle restarting yourself.
add a comment
|
This is a bug in systemd, where a service which fails all of its restarts gets listed as "inactive" rather than "failed". In my testing it occurs in 229 (default with Ubuntu Xenial), and is fixed in 238; maybe some changelog snooping will reveal which version fixed it.
The best workaround seems to be to remove Restart
from your service file and manually handle restarting yourself.
add a comment
|
This is a bug in systemd, where a service which fails all of its restarts gets listed as "inactive" rather than "failed". In my testing it occurs in 229 (default with Ubuntu Xenial), and is fixed in 238; maybe some changelog snooping will reveal which version fixed it.
The best workaround seems to be to remove Restart
from your service file and manually handle restarting yourself.
This is a bug in systemd, where a service which fails all of its restarts gets listed as "inactive" rather than "failed". In my testing it occurs in 229 (default with Ubuntu Xenial), and is fixed in 238; maybe some changelog snooping will reveal which version fixed it.
The best workaround seems to be to remove Restart
from your service file and manually handle restarting yourself.
answered Apr 1 '18 at 21:17
Edward Z. YangEdward Z. Yang
1265 bronze badges
1265 bronze badges
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%2f396075%2fsystemctl-failed-not-listing-failed-instantiated-service%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
The service isn't actually in an inactive state. If you run, "systemctl --failed --all" as suggested, you should see it.
– Raman Sailopal
Oct 4 '17 at 13:53
you are right, of course. It's just confusing that in the output of the status command it says right there 'unit entered failed state'
– natxo asenjo
Oct 4 '17 at 14:55
for what it's worth, I have fixed it by remove the Type=simple (which is the default anyway) and adding a RestartPreventExitStatus=1 directive. Now it fails
– natxo asenjo
Oct 4 '17 at 14:57