Ionice is a standard linux command that allows to set the io priority for a process:
Do children processes inherit ionice priorities from their parents? How do you check the io priority of a running process?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Any processes that are forked inherit the io class and priority of their parent, however an important fact to keep in mind is that if you alter the io class and/or priority of a running process it doesn't change the io class/priority of any current child processes of that process. That said, once you have adjusted the class and/or priority of a running process, any child processes that are forked going forward will inherit the new io class and priority.
Yes and this is how I tested it
Create two files
# ==> foo.sh <== echo $$ ionice
# ==> nicechange.sh <== echo $$ echo -n Before change: ionice echo Change to best-effort ionice -c best-effort -p $$ echo After changed ionice echo Subprocess x=$(bash foo.sh) echo $x
Then, run it:
$ bash nicechange.sh 2549 Before change:idle Change to best-effort After changed best-effort: prio 4 Subprocess 2555 best-effort: prio 4