NAME 

run - control process scheduler attributes and CPU affinity

SYNOPSIS 

run [OPTIONS] { COMMAND [ARGS] | PROCESS/THREAD_SPECIFIER }

DESCRIPTION 

run executes the specified command in the environment described by the list of options and exits with the command's exit value. If a specifier is given, run modifies the environment of the set of processes or threads selected by the specifier.

OPTIONS 

One or more of the following:
--bias=list, -b list
Runs command with the given CPU list. list is a comma-separated list of CPU IDs or CPU ID ranges. For example: "0,2-4,6". list may also be "active" or "boot" to specify all active processors or the boot processor, respectively. The CAP_SYS_NICE capability is required to add additional CPUs to a bias.
--copies=count, -c count
Runs the specified number of identical copies of the command.
--policy=policy, -s policy
Runs command under the specified scheduling policy. Valid keywords are: SCHED_FIFO, SCHED_RR, and SCHED_OTHER. These may be abbreviated as fifo, rr, and other. Refer to (2) and (2) for more information on scheduling policies. The scheduling priority defaults to 0 under the new policy unless -P is used to specify a different priority.
--priority=priority, -P priority
Runs command with the given priority. Priority must be an integer value that is valid for the current scheduling policy (or the specified scheduling policy if the -s option is used). Higher numerical values represent more favorable scheduling priorities.
--quantum={quantum | list}, -q {quantum | list}
Runs the command with the given quantum. A quantum value is meaningful only under the SCHED_RR and SCHED_OTHER scheduling policies. quantum is specified either as a nice value or a millisecond value corresponding to a nice value. Nice values must be between -20 and 19 inclusive. By default, a quantum value of -20 results in a ~200ms slice, and a quantum value of 19 results in a ~10ms slice. Millisecond values are in the form numberms and must reflect the times defined in the system for the nice values. If a non-defined millisecond value is supplied, an "unsupported quantum" error message is returned. Specifying "list" displays a table containing the nice values and their millisecond equivalents.
--negate, -N
Negate the CPU bias list. A bias list option must also be specified when the negate option is specified. The bias used will contain all CPUs on the system except those specified in the bias list.
--fork, -f
Causes run to execute the specified command in the background and return immediately.
--info, -i
Output process environment information for the specified process(es) or thread(s). When no specifier is given, this option causes run to display information on the run process itself.
--verbose, -v
Causes information to be displayed before every operation that is performed.
--help, -h
Display help information and exit.
--version, -V
Display version information and exit.

PROCESS/THREAD_SPECIFIER 

Used to specify the processes or threads to be acted upon. Only one of the following may be specified:

--all, -a
Select all existing processes and threads. As protection against catastrophic system failure on non-RedHawk systems, root is not allowed to use this option combined with requests for scheduler or affinity changes.
--pid=list, -p list
Specify a list of existing PIDs to modify. All scheduler operations are specific to the complete set of processes listed including the complete set of all their sub-threads.
--tid=list, -t list
Specify a list of existing TIDs to modify. All scheduler operations are specific to only the listed threads and not unspecified sibling threads in the process. For compatibility with Concurrent's PowerMAX OS, -l list can be used.
--group=list, -g list
Specify a list of process groups to modify; all existing processes in the process groups listed are modified.
--user=list, -u list
Specify a list of users to modify; all existing processes owned by the users listed will be modified. Each user in the list may either be a valid numeric user ID or character login ID.
--name=list, -n list
Specify a list of existing process names to modify.

Multiple comma separated values can be specified for all lists and ranges are allowed where appropriate (e.g. "run -b 0,2-4,6 autopilot").

For options that require a keyword, the equal sign between the option and the keyword can be omitted (e.g. run --priority=24 and run --priority 24 are functionally the same.)

A command may not be combined with a specifier on the same command line invocation.

EXAMPLES 

The following command runs make(1) in the background on any of CPUs 0-3 under the default SCHED_OTHER scheduling policy with default priority.

run --bias=0-3 make &

The following command runs date(1) with a priority of 10 in the SCHED_RR (i.e. Round Robin) scheduling policy.

run -s SCHED_RR -P 10 date

The following command changes the scheduling priority of process ID 987 to level 32.

run --priority=32 -p 987

The following command moves all processes in process group 1456 to CPU 3.

run -b 3 -g 1456

The following command sets all processes whose name is "pilot" to run in the SCHED_FIFO (i.e. First-In-First-Out) scheduling policy with a priority of 21.

run -s fifo -P 21 -n pilot

EXIT STATUS 

Normally, the exit status is zero. However, if an error occurs while trying to change the process environment, a diagnostic message is issued and an exit status of 1 is returned.

If a command is specified, the exit status of run is the exit status of the command, unless an error occurs while trying to change the process environment. In this case, a diagnostic message is printed and an exit status of 1 is returned.

If a command is specified and the --fork or --copies option is also specified, the return code of the invoked command is ignored and the exit status is zero unless an error occurs trying to change the process environment. In this case, a diagnostic message is printed and an exit status of 1 is returned.

COPYRIGHT 

Copyright (C) 2001 Concurrent Computer Corporation

The run source code is licensed under the GNU GPL Version 2. Libraries used by the run command are licensed under the GNU LGPL Version 2.1. Author: Jason Baietto (jason.baietto@ccur.com)