https://github.com/quark-zju/lrun/releases,下载源代码
1.安装rake
sudo apt-get install rake
2.进入解压后的目录,make install
make install
3.查看用户id
id gjq
结果:
uid=1000(gjq) gid=1000(gjq) groups=1000(gjq),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare),999(docker),593(lrun)
root@gjq-virtual-machine:~# lrun --max-real-time 1.0 --uid 1000 --gid 1000 sleep 2 3>&1
结果:
MEMORY 208896 cpuTIME 0.002 REALTIME 1.000 SIGNALED 0 EXITCODE 0 TERMSIG 0 EXCEED REAL_TIME
原文链接:https://www.f2er.com/ubuntu/351125.html