Transmission:Unable to save resume file: Too many open files

/ 0评 / 0

群晖 transmission: Unable to save resume file: Too many open files 故障解决

最近拿到了HDSKY的药,为了冲流量下了很多东西,结果传说中的 Too many open files 问题不期而遇。

在修改 ulimit -n 4096 无果后,不得已尝试了编译 rlimit 定时任务的方式,最终解决了问题。

处理方式

1. 安装GCC

sudo dnf update
sudo dnf groupinstall "Development Tools"

 

2. 编译rlimit

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>

int main(int argc, char** argv) {
pid_t pid;
struct rlimit new_limit;
int result;
if (argc < 2) {
return 1;
}
pid = atoi(argv[1]);
new_limit.rlim_cur = 60000;
new_limit.rlim_max = 60000;
result = prlimit(pid, RLIMIT_NOFILE, &new_limit, NULL);
return result;
}

 

gcc -o rlimit rlimit.c

 

3.添加定时任务

 

解决前

解决后

 

返回首页

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注