Inactive service of hello world #yocto
Hi everyone,
I wanted to run the helloworld service, but it keeps telling that its inactive , I really cant find why, I changed the service many times but no solution. I m sorry I ant copy paste from putty
What does your 'Hello World' service do? Just print 'Hello World' to the console and then exit?
If so that would be the reason why it is inactive. Systemd starts it and then it exits. Typically, services keep running (except for some special cases) once they are started. That's what makes them a service. To stop them 'systemctl stop <service>' is used. By default systemctl sends SIGTERM to tell the service to clean up and terminate itself.
:rjs
Quoted 10 lines · On Tue, Sep 7, 2021, 10:20 <[email protected]> wrote:
Hi everyone,
I wanted to run the helloworld service, but it keeps telling that its inactive , I really cant find why, I changed the service many times but no solution.
I m sorry I ant copy paste from putty
Quoted 9 lines · Rudolf J Streif
What does your 'Hello World' service do? Just print 'Hello World' to the console and then exit?
If so that would be the reason why it is inactive. Systemd starts it and then it exits. Typically, services keep running (except for some special cases) once they are started. That's what makes them a service. To stop them 'systemctl stop <service>' is used. By default systemctl sends SIGTERM to tell the service to clean up and terminate itself.
To piggyback on that, it is possible to set Type=oneshot[1] for the service so that systemd considers the service to be up after it exited. I find it useful for init or migration scripts that another service can then depend upon.
[1]:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
Quoted 16 lines
:rjs
Quoted 9 lines · On Tue, Sep 7, 2021, 10:20 <[email protected]> wrote:
Hi everyone,
I wanted to run the helloworld service, but it keeps telling that its inactive , I really cant find why, I changed the service many times but no solution.
I m sorry I ant copy paste from putty