GNOME Bugzilla – Bug 671162
jhbuild doesn't work if old chrt or ionice is installed
Last modified: 2012-03-07 14:47:42 UTC
I'm trying to use jhbuild for another project and my colleague just found this issue when using it on OpenSuse 11.0. Change 0e453d94 introduced nice_build option that uses chrt and ionice programs if found. The presence of these programs is checked, but versions or accepted parameters not. Old versions of these programs take different parameters and jhbuild doesn't work. Here are parameters of that versions (chrt is missing --idle): chrt (util-linux-ng 2.13.1) usage: chrt [options] [prio] [pid | cmd [args...]] manipulate real-time attributes of a process -b, --batch set policy to SCHED_BATCH -f, --fifo set policy to SCHED_FIFO -p, --pid operate on existing given pid -m, --max show min and max valid priorities -o, --other set policy to SCHED_OTHER -r, --rr set policy to SCHED_RR (default) -h, --help display this help -v, --verbose display status information -V, --version output version information You must give a priority if changing policy. Usage: ionice [OPTIONS] [COMMAND [ARG]...] Sets or gets process io scheduling class and priority. -n Class data (typically 0-7, lower being higher prio) -c Scheduling class 1: realtime, 2: best-effort, 3: idle -p Process pid -h This help page
Created attachment 208813 [details] [review] terminal: Avoid passing invalid arguments if ionice/chrt are too old
Can you test?
Thanks for quick reply! I'll test it tomorrow.
it doesn't work major problem is that ionice returns 0 even if it gets invalid option: >>> subprocess.call(['ionice', '-c', '3', '-t', 'true']) ionice: invalid option -- t Usage: ionice [OPTIONS] [COMMAND [ARG]...] Sets or gets process io scheduling class and priority. -n Class data (typically 0-7, lower being higher prio) -c Scheduling class 1: realtime, 2: best-effort, 3: idle -p Process pid -h This help page Jens Axboe <axboe@suse.de> (C) 2005 0 and minor issue is that these error messages go to the terminal. I guess you will need to parse stdout or stderr to determine if ionice works. The first line ("invalid option") goes to stderr, the usage goes to stdout.
Created attachment 209002 [details] [review] terminal: Avoid passing invalid arguments if ionice/chrt are too old Check ionice's stderr, ensure it's empty
Does the above patch work?
works! thanks!
Attachment 209002 [details] pushed as aac1075 - terminal: Avoid passing invalid arguments if ionice/chrt are too old