admin管理员组文章数量:1415655
I have a service file foo.service
that is configured to auto-start after a target init_done.target
.
[Unit]
After=init_done.target
...
[Install]
WantedBy=multi-user.arget
If I run systemctl stop foo.service
before foo.service
is ready (i.e., init_done.target
has become active), a message can be seen in the log: "Stopped Foo Service.
"
systemctl status foo
● foo.service - Foo Service
Loaded: loaded (/etc/systemd/system/foo.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Feb 12 01:23:45 user systemd[1]: Stopped Foo Service.
I presumed this systemctl stop
command is a no-op, because foo.service
has yet to become active which means there is nothing to stop.
However, it turns out that running the systemctl stop foo.service
command this early on in the boot sequence actually prevents foo.service
from starting even when init_done.target
eventually becomes active. This is surprising to me because I thought using systemctl stop
in this manner should be a no-op as I explained above. Is this the expected behavior? And where can I find documentation on this? I've read through the man page and can't find a direct answer on what should happen when systemctl stop
is used on an inactive target that is configured to auto-start after a specific target becomes active.
For the record, the systemctl
in question is on version 229.
本文标签:
版权声明:本文标题:system design - What is the expected behavior for stopping an inactive systemd service that is configured to auto-start? - Stack 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745165797a2645669.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论