Automatically adjusting process priorities under Linux

Viewed 4161

I'm trying to write a program that automatically sets process priorities based on a configuration file (basically path - priority pairs).

I thought the best solution would be a kernel module that replaces the execve() system call. Too bad, the system call table isn't exported in kernel versions > 2.6.0, so it's not possible to replace system calls without really ugly hacks.

I do not want to do the following:

-Replace binaries with shell scripts, that start and renice the binaries. -Patch/recompile my stock Ubuntu kernel -Do ugly hacks like reading kernel executable memory and guessing the syscall table location -Polling of running processes

I really want to be:

-Able to control the priority of any process based on it's executable path, and a configuration file. Rules apply to any user.

Does anyone of you have any ideas on how to complete this task?

7 Answers
Related