TransWikia.com

Linux systemd: remove slice

Server Fault Asked by Mike S on September 20, 2020

Out of curiosity, is there any way to remove a systemd slice that you’ve created? I’m running on Fedora 28 with systemd-238-9 and kernel 4.17.12-200.fc28.x86_64 .

I performed:

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

And after the top had exited, I can see my slice:

systemctl -t slice --all

But I can’t remove it. I have tried

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

(the latter gives an “unknown operation”), but still my slice lives in that list.

Thanks.

One Answer

On my FC28 system the test slice disappears after the systemctl stop test.slice command. Trying the kill afterwards gives this result:

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

Answered by John Damm Sørensen on September 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP