Show Table of Contents
2.2. 删除控制群组
临时 cgroup 所包含的进程一旦结束,临时 cgroup 就会被自动释放。通过将
--remain-after-exit
选项传递给 systemd-run
,您可以在其进程结束后,让单位继续运行来收集运行时的信息。如要单位停止运行,请输入:
systemctl
stop
name.service
如果您希望一个 service 停止运行,请将 name 替换成此 service 的名字。如要终止一个或多个单位中的进程,请以
root
身份输入:
systemctl
kill
name.service
--kill-who
=PID,...--signal
=signal
用单位名(如 httpd.service)替代 name。使用
--kill-who
从 cgroup 中挑选您希望结束的进程。如要同时终止多项进程,请传送一份 PID 的逗号分隔列表。用您希望发送至指定进程的 POSIX 信号类型替代 signal。默认情况下是 SIGTERM。更多信息,请参阅 systemd.kill
manual page。
当单位被禁用并且其配置文件通过运行(下列行)被删除,永久 cgroup 会被释放:
systemctl
disable
name.service
此处,name 代表您希望禁用的 service 名字。
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.