linux – 如何为用户提供ionice级别权限?

前端之家收集整理的这篇文章主要介绍了linux – 如何为用户提供ionice级别权限?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
要改变hardlimit for nice,我可以修改/etc/security/limits.conf
user - nice -11

但是我怎样才能为ionice做同样的事情

ionice -c 1 -p 31828

我收到了错误

ionice: ioprio_set Failed: Operation not permitted

解决方法

错误(EPERM)表示您没有足够的权限来执行该操作. ioprio_set():

An unprivileged process may only set the I/O
priority of a process whose real UID matches the real or effective UID
of the calling process. A process which has the CAP_SYS_NICE
capability can change the priority of any process.

因此,要么成为超级用户(使用sudo),要么在自己的一个进程上使用ionice.

原文链接:https://www.f2er.com/linux/394735.html

猜你在找的Linux相关文章