Linux systemd:刪除切片

Linux systemd:刪除切片

出於好奇,有什麼方法可以刪除您建立的 systemd 切片嗎?我在帶有 systemd-238-9 和內核 4.17.12-200.fc28.x86_64 的 Fedora 28 上運行。

我執行:

systemd-run --unit=toptest --slice=test top -b

退出後top,我可以看到我的切片:

systemctl -t slice --all

但我無法刪除它。我努力了

systemctl stop test.slice
systemctl kill test.slice
systemctl unload test.slice

(後者給出了“未知操作”),但我的切片仍然存在於該列表中。

謝謝。

答案1

在我的 FC28 系統上,測試切片在systemctl stop test.slice命令後消失。之後嘗試殺死會得到以下結果:

systemctl kill  test.slice
Failed to kill unit test.slice: Unit test.slice not loaded.

相關內容