Write error: /proc/$PID/oom_adj


Recommended Posts

unRaid version: 5.0-beta11 VM

 

Trying to do the following. Not getting OOM but would like to have it in place just in case:

pgrep -f "/usr/local/sbin/emhttp" | while read PID; do echo -1000 > /proc/$PID/oom_adj; done

 

Gives me:

root@Tower:/root -> pgrep -f "/usr/local/sbin/emhttp" | while read PID; do echo -1000 > /proc/$PID/oom_adj; done

-bash: echo: write error: Invalid argument

 

So stepping thru it:

 

root@Tower:/root -> pgrep -f "/usr/local/sbin/emhttp" | while read PID; do echo $PID; done

1378

 

root@Tower:/root -> ls -l /proc/ | grep 1378

dr-xr-xr-x  6 root      root                0 2013-07-10 09:16 1378/

dr-xr-xr-x  6 root      root                0 2013-07-10 11:02 13785/

dr-xr-xr-x  6 root      root                0 2013-07-10 11:00 13786/

root@Tower:/root -> ls -l /proc/1378

total 0

-r-------- 1 root root 0 2013-07-10 11:08 auxv

--w------- 1 root root 0 2013-07-10 11:08 clear_refs

-r--r--r-- 1 root root 0 2013-07-10 11:08 cmdline

-rw-r--r-- 1 root root 0 2013-07-10 11:08 comm

-rw-r--r-- 1 root root 0 2013-07-10 11:08 coredump_filter

lrwxrwxrwx 1 root root 0 2013-07-10 11:08 cwd -> //

-r-------- 1 root root 0 2013-07-10 11:08 environ

lrwxrwxrwx 1 root root 0 2013-07-10 11:08 exe -> /usr/local/sbin/emhttp*

dr-x------ 2 root root 0 2013-07-10 11:08 fd/

dr-x------ 2 root root 0 2013-07-10 11:08 fdinfo/

-r--r--r-- 1 root root 0 2013-07-10 11:08 limits

-r--r--r-- 1 root root 0 2013-07-10 11:08 maps

-rw------- 1 root root 0 2013-07-10 11:08 mem

-r--r--r-- 1 root root 0 2013-07-10 11:08 mountinfo

-r--r--r-- 1 root root 0 2013-07-10 11:08 mounts

-r-------- 1 root root 0 2013-07-10 11:08 mountstats

dr-xr-xr-x 4 root root 0 2013-07-10 11:08 net/

-rw-r--r-- 1 root root 0 2013-07-10 11:08 oom_adj

-r--r--r-- 1 root root 0 2013-07-10 11:08 oom_score

-rw-r--r-- 1 root root 0 2013-07-10 11:08 oom_score_adj

-r-------- 1 root root 0 2013-07-10 11:08 pagemap

-r-------- 1 root root 0 2013-07-10 11:08 personality

lrwxrwxrwx 1 root root 0 2013-07-10 11:08 root -> //

-r--r--r-- 1 root root 0 2013-07-10 11:08 smaps

-r--r--r-- 1 root root 0 2013-07-10 11:08 stat

-r--r--r-- 1 root root 0 2013-07-10 11:08 statm

-r--r--r-- 1 root root 0 2013-07-10 11:08 status

-r-------- 1 root root 0 2013-07-10 11:08 syscall

dr-xr-xr-x 4 root root 0 2013-07-10 11:02 task/

-r--r--r-- 1 root root 0 2013-07-10 11:08 wchan

root@Tower:/root -> cat /proc/1378/oom_adj

0

root@Tower:/root -> echo -1000

-1000

root@Tower:/root -> echo -1000 >  /proc/1378/oom_adj

-bash: echo: write error: Invalid argument

root@Tower:/root ->

 

 

Link to comment

No one?

 

Am I doing something wrong or can you no longer modify emhttp so that it is better protected from OOM situations?

You ARE doing something wrong.

The /proc parameter changed from when in the 4.7 series.  It is no longer named oom_adj in the newer kernels.

It is named oom_score_adj

 

pgrep -f "/usr/local/sbin/emhttp" | while read PID; do echo -1000 > /proc/$PID/oom_score_adj; done

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.