Bug 8898 - prlimit 命令限制进程资源报错
Summary: prlimit 命令限制进程资源报错
Status: RESOLVED FIXED
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: BaseOS Modules (show other bugs) BaseOS Modules
Version: 8.9
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: geliwei-ali
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-26 14:37 UTC by songkai
Modified: 2024-04-29 19:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description songkai inspur_group 2024-04-26 14:37:06 UTC
Description of problem:

    prlimit 命令限制进程资源报错

Version-Release number of selected component (if applicable):

    util-linux-2.32.1-44.0.1.an8.1.x86_64

Steps to Reproduce:
1. 在龙蜥系统中执行一个程序,获取进程号
2. 使用prlimit -c=1 + 进程号

Actual results:

报错prlimit: failed to parse CORE limit

Expected results:

无输出,正确设置
Comment 1 wangzhe 2024-04-29 19:38:50 UTC
(In reply to songkai from comment #0)
> Description of problem:
> 
>     prlimit 命令限制进程资源报错
> 
> Version-Release number of selected component (if applicable):
> 
>     util-linux-2.32.1-44.0.1.an8.1.x86_64
> 
> Steps to Reproduce:
> 1. 在龙蜥系统中执行一个程序,获取进程号
> 2. 使用prlimit -c=1 + 进程号
> 
> Actual results:
> 
> 报错prlimit: failed to parse CORE limit
> 
> Expected results:
> 
> 无输出,正确设置


如果是想限制某进程的 core 文件大小,请使用命令 prlimit --core=$size -p $pid

[root@test ~]# prlimit -c -p 17823
RESOURCE DESCRIPTION        SOFT      HARD UNITS
CORE     max core file size    0 unlimited blocks
[root@test ~]# 
[root@test ~]# prlimit -c=1 -p 17823
prlimit: failed to parse CORE limit
[root@test ~]# 
[root@test ~]# prlimit --core=1024 -p 17823
[root@test ~]# prlimit -c -p 17823
RESOURCE DESCRIPTION        SOFT HARD UNITS
CORE     max core file size 1024 1024 blocks
[root@test ~]#