Why the line of Active: active (running) just show running or dead when I sytemctl status?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to check the state of systemd
service(test.service) by systemctl status test.service
.But why the line of Active: active (running)
just show running or dead rather than starting/stopping/running/dead?
systemd
add a comment |Â
up vote
0
down vote
favorite
I am trying to check the state of systemd
service(test.service) by systemctl status test.service
.But why the line of Active: active (running)
just show running or dead rather than starting/stopping/running/dead?
systemd
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to check the state of systemd
service(test.service) by systemctl status test.service
.But why the line of Active: active (running)
just show running or dead rather than starting/stopping/running/dead?
systemd
I am trying to check the state of systemd
service(test.service) by systemctl status test.service
.But why the line of Active: active (running)
just show running or dead rather than starting/stopping/running/dead?
systemd
asked May 8 at 5:47
user289678
52
52
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19
add a comment |Â
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
It does. I guess you're holding it wrong.
$ systemd-run --user --no-block --service=oneshot sleep 10
Running as unit: run-r0b9dce0a8bd649d4a2e91d23fe757937.service
$ systemctl status --user run-r0b9dce0a8bd649d4a2e91d23fe757937.service
â run-r0b9dce0a8bd649d4a2e91d23fe757937.service - /usr/bin/sleep 10
Loaded: loaded (/run/user/1001/systemd/transient/run-r0b9dce0a8bd649d4a2e91d23fe757937.service; transient)
Transient: yes
Active: activating (start) since Thu 2018-05-17 10:49:43 BST; 9s ago
Main PID: 7949 (sleep)
CGroup: /user.slice/user-1001.slice/user@1001.service/run-r0b9dce0a8bd649d4a2e91d23fe757937.service
âÂÂâÂÂ7949 /usr/bin/sleep 10
May 17 10:49:43 alan-laptop systemd[1667]: Starting /usr/bin/sleep 10...
Specifically, if you want systemd to be able to tell whether your service is started or starting, your service needs to actually tell it somehow. systemd supports a few different ways of this. The answer linked here shows one of them: "How can I show current service state of systemd service?", it shows how you can do this when writing a service daemon (long-running process) in either a shell script or in C.
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
add a comment |Â
up vote
0
down vote
The status of your service will be the current status. To see when the service was in fact started, check your journal log:
journalctl | grep test.service
This will show you when the service was started, and at this stage the status would have been in the activating stage.
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
It does. I guess you're holding it wrong.
$ systemd-run --user --no-block --service=oneshot sleep 10
Running as unit: run-r0b9dce0a8bd649d4a2e91d23fe757937.service
$ systemctl status --user run-r0b9dce0a8bd649d4a2e91d23fe757937.service
â run-r0b9dce0a8bd649d4a2e91d23fe757937.service - /usr/bin/sleep 10
Loaded: loaded (/run/user/1001/systemd/transient/run-r0b9dce0a8bd649d4a2e91d23fe757937.service; transient)
Transient: yes
Active: activating (start) since Thu 2018-05-17 10:49:43 BST; 9s ago
Main PID: 7949 (sleep)
CGroup: /user.slice/user-1001.slice/user@1001.service/run-r0b9dce0a8bd649d4a2e91d23fe757937.service
âÂÂâÂÂ7949 /usr/bin/sleep 10
May 17 10:49:43 alan-laptop systemd[1667]: Starting /usr/bin/sleep 10...
Specifically, if you want systemd to be able to tell whether your service is started or starting, your service needs to actually tell it somehow. systemd supports a few different ways of this. The answer linked here shows one of them: "How can I show current service state of systemd service?", it shows how you can do this when writing a service daemon (long-running process) in either a shell script or in C.
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
add a comment |Â
up vote
0
down vote
accepted
It does. I guess you're holding it wrong.
$ systemd-run --user --no-block --service=oneshot sleep 10
Running as unit: run-r0b9dce0a8bd649d4a2e91d23fe757937.service
$ systemctl status --user run-r0b9dce0a8bd649d4a2e91d23fe757937.service
â run-r0b9dce0a8bd649d4a2e91d23fe757937.service - /usr/bin/sleep 10
Loaded: loaded (/run/user/1001/systemd/transient/run-r0b9dce0a8bd649d4a2e91d23fe757937.service; transient)
Transient: yes
Active: activating (start) since Thu 2018-05-17 10:49:43 BST; 9s ago
Main PID: 7949 (sleep)
CGroup: /user.slice/user-1001.slice/user@1001.service/run-r0b9dce0a8bd649d4a2e91d23fe757937.service
âÂÂâÂÂ7949 /usr/bin/sleep 10
May 17 10:49:43 alan-laptop systemd[1667]: Starting /usr/bin/sleep 10...
Specifically, if you want systemd to be able to tell whether your service is started or starting, your service needs to actually tell it somehow. systemd supports a few different ways of this. The answer linked here shows one of them: "How can I show current service state of systemd service?", it shows how you can do this when writing a service daemon (long-running process) in either a shell script or in C.
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
It does. I guess you're holding it wrong.
$ systemd-run --user --no-block --service=oneshot sleep 10
Running as unit: run-r0b9dce0a8bd649d4a2e91d23fe757937.service
$ systemctl status --user run-r0b9dce0a8bd649d4a2e91d23fe757937.service
â run-r0b9dce0a8bd649d4a2e91d23fe757937.service - /usr/bin/sleep 10
Loaded: loaded (/run/user/1001/systemd/transient/run-r0b9dce0a8bd649d4a2e91d23fe757937.service; transient)
Transient: yes
Active: activating (start) since Thu 2018-05-17 10:49:43 BST; 9s ago
Main PID: 7949 (sleep)
CGroup: /user.slice/user-1001.slice/user@1001.service/run-r0b9dce0a8bd649d4a2e91d23fe757937.service
âÂÂâÂÂ7949 /usr/bin/sleep 10
May 17 10:49:43 alan-laptop systemd[1667]: Starting /usr/bin/sleep 10...
Specifically, if you want systemd to be able to tell whether your service is started or starting, your service needs to actually tell it somehow. systemd supports a few different ways of this. The answer linked here shows one of them: "How can I show current service state of systemd service?", it shows how you can do this when writing a service daemon (long-running process) in either a shell script or in C.
It does. I guess you're holding it wrong.
$ systemd-run --user --no-block --service=oneshot sleep 10
Running as unit: run-r0b9dce0a8bd649d4a2e91d23fe757937.service
$ systemctl status --user run-r0b9dce0a8bd649d4a2e91d23fe757937.service
â run-r0b9dce0a8bd649d4a2e91d23fe757937.service - /usr/bin/sleep 10
Loaded: loaded (/run/user/1001/systemd/transient/run-r0b9dce0a8bd649d4a2e91d23fe757937.service; transient)
Transient: yes
Active: activating (start) since Thu 2018-05-17 10:49:43 BST; 9s ago
Main PID: 7949 (sleep)
CGroup: /user.slice/user-1001.slice/user@1001.service/run-r0b9dce0a8bd649d4a2e91d23fe757937.service
âÂÂâÂÂ7949 /usr/bin/sleep 10
May 17 10:49:43 alan-laptop systemd[1667]: Starting /usr/bin/sleep 10...
Specifically, if you want systemd to be able to tell whether your service is started or starting, your service needs to actually tell it somehow. systemd supports a few different ways of this. The answer linked here shows one of them: "How can I show current service state of systemd service?", it shows how you can do this when writing a service daemon (long-running process) in either a shell script or in C.
edited May 17 at 9:55
answered May 17 at 9:50
sourcejedi
18.2k32475
18.2k32475
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
add a comment |Â
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
Yes. it's my misunderstanding.And thanks for your words,I have got it.
â user289678
May 18 at 6:51
add a comment |Â
up vote
0
down vote
The status of your service will be the current status. To see when the service was in fact started, check your journal log:
journalctl | grep test.service
This will show you when the service was started, and at this stage the status would have been in the activating stage.
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
add a comment |Â
up vote
0
down vote
The status of your service will be the current status. To see when the service was in fact started, check your journal log:
journalctl | grep test.service
This will show you when the service was started, and at this stage the status would have been in the activating stage.
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The status of your service will be the current status. To see when the service was in fact started, check your journal log:
journalctl | grep test.service
This will show you when the service was started, and at this stage the status would have been in the activating stage.
The status of your service will be the current status. To see when the service was in fact started, check your journal log:
journalctl | grep test.service
This will show you when the service was started, and at this stage the status would have been in the activating stage.
answered May 8 at 10:33
YodaScholtz
1262
1262
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
add a comment |Â
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Thanks ! Can I read the log by line in my code ,so that I can do something by it's content.
â user289678
May 9 at 3:40
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
Try to format your questions on Stackexchange with a definite problem, and some context to help us find a definite solution, rather than creating a discussion. You can read the log line by line after the fact, but that's another rabbit hole that we can't discuss here.
â YodaScholtz
May 9 at 5:50
OK, thank you !
â user289678
May 9 at 8:44
OK, thank you !
â user289678
May 9 at 8:44
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442469%2fwhy-the-line-of-active-active-running-just-show-running-or-dead-when-i-sytemc%23new-answer', 'question_page');
);
Post as a guest
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
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
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
The current state of a service such as starting/started/running/stopping/stopped
â user289678
May 8 at 6:19