1

I have a script (extendscript for AE) that create a command file and execute it. the generated command file look like:

FILE=/path/file
VAR="nice -n 9 ./application  $FILE "
cd /Applications/applicationpath
$VAR

Once my script is launching by the application I run :
ps -lp {processID} on terminal and I get NI = 0 whatever the number I put after nice -n
If I manually renice the process, then ps -lp displays the correct process priority

Am I doing something wrong?

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
MSH
  • 11
  • 4
  • It works fine for me, in 10.6.8. – Barmar May 05 '15 at 20:19
  • does ps -lp return you the correct priority? i am on 10.10.3 – MSH May 05 '15 at 20:38
  • I did `ps -l`, and it showed `PRI=22` and `NI=9`. `ps -lp` complains that `-p` requires an argument. Also had `N` in the `S` column – Barmar May 05 '15 at 21:27
  • Ok I understood where I messed Up. The program Launched is starting multiple process and it is these process that are ressource intensive and would need to be renice. however I dont know how to access them in order to renice them. anyway thanks everybody! is it posible to renice a process without knowing its PID? – MSH May 06 '15 at 20:09
  • If they're truly child processes, they should inherit the priority. But if they're being launched through `launchd` (like most windowed applications), the priority won't be passed along. There might be some way to tell `launchd` to nice a process before it starts it. apple.stackexchange.com would probably be a good place to ask. – Barmar May 06 '15 at 20:36
  • thanks ! I'll post over there :) – MSH May 07 '15 at 14:03

0 Answers0