1

I'm trying to limit a Linux user via cgroups. I used the following command:

systemctl set-property user-1007.slice CPUQuota=50%

The number 1007 is the user id I want to limit.

But after executing that, I get the following message:

Failed to set unit properties on user-1007.slice: Unit user-1007.slice
is not loaded.

I tried searching the interwebs, but could not find anything.

Any help is greatly appreciated.


  • CentOS Linux release 7.2.1511 (Core)
  • Your question needs to explain why you thought that it was loaded, and why you picked the number 1007. – JdeBP Aug 17 '17 at 19:24
  • That's the user id 1007. Why I thought it was loaded? I didn't think I had to load anything? I'm fairly new too cgroups. – blade19899 Aug 17 '17 at 19:53
0

User with id 1007 not logged in. First login as that user then set limits

systemctl set-property user-1007.slice CPUQuota=50%

You can use this command to list all active slice or append --all to list all

systemctl list-units --type=slice

See this thread for more info http://www.webhostingtalk.com/showthread.php?t=1540450

  • This did not work. I After the first command, I had to input the root password, and even after that, I got the same error Failed to set unit properties on user-1007.slice: Unit user-1007.slice is not loaded.. – blade19899 Aug 23 '17 at 13:09
  • In one terminal login as 1007. In another terminal run this 'systemd-cgtop' and see whether the 1007 slice is loaded. Then run 'systemctl set-property user-1007.slice CPUQuota=50%'. – cguruz Aug 28 '17 at 0:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.