[plug] Process Scheduling

James Devenish devenish at guild.uwa.edu.au
Fri Jun 13 08:47:32 WST 2003


In message <3EE87BF8.4030605 at postnewspapers.com.au>
on Thu, Jun 12, 2003 at 09:11:20PM +0800, Craig Ringer wrote:
> A setuid copy of renice called,

If available, a hard link might be a better idea (in terms of
maintenance)?

But as Craig mentioned, giving users full access to renice could be a
little dangerous since they can change the priority of arbitrary
processes (or change their own process priorities to aggressive values).
Unless you have some way of controlling syscall usage on your
machine(s), you may wish to write a short shell script that does
something conceptually like this:

    PRIORITY=$1
    shift
    renice $PRIORITY `pgrep -U $SUDO_USER $*`

...which users could then invoke as `scriptname -2 mozilla` to bump up
the priority of that user's mozilla processes.

In message <4AB94D2C-9CD4-11D7-9968-0003939B35CC at bur.st>
on Thu, Jun 12, 2003 at 08:49:23PM +0800, Luke Brown wrote:
> Can anyone vouch for a good process scheduling tool that can allow 
> users to allocate processes with priorities kinda like nice, but with 
> the ability to increase not just decrease etc?

Scheduling is handled by the kernel, so there is not normally a way to
do this without being root. However, the `sudo` programme can be used to
allow named users (or users from particular groups) to run
highly-specific commands as the root user (or any other user, though
only root will suffice in this case). It is slightly more complicated
than a setuid programme, since users will have to enter their password
when they invoke sudo for the first time in a five-minute timeframe
(though this can be disabled in sudo's config, if you like). Their
actions are logged by sudo and you can copy the sudo configuration from
machine to machine.




More information about the plug mailing list