startpar
Run System V init scripts in parallel
SYNOPSIS
startpar [options] command
PARAMETERS
-a
All files are executed: normally startpar skips if the runlevel does not match the basename of the script.
-b
Fork to background before starting the programs. This will disconnect the starting programs from the TTY the current process uses.
-c command
Specifies an init script command to execute (e.g., start, stop, restart).
-d directory
Specifies an alternative directory containing init scripts. Defaults to /etc/init.d or /etc/rcX.d.
-f number
Forces parallelism even if some services lack LSB headers. 'number' is the maximum number of processes to start at once. Use with extreme caution.
-n
No fork. Do not fork, run serial and single process, one process at a time.
-p
Print the commands that will be executed without actually executing them. Debug Mode.
-q
Quiet mode.
-s
Single process mode: execute all scripts serially (not parallel).
-t timeout
Specifies a timeout (in seconds) for each init script to complete.
-T
No timeout, startpar will not use the timeout.
-v
Verbose mode: display more detailed information about the execution process.
-V
Display version information.
DESCRIPTION
startpar is a utility designed to execute System V init scripts in parallel, speeding up system boot and shutdown processes. It analyzes the init scripts and their dependencies to determine a safe and efficient execution order.
startpar is typically invoked by the init system (like systemd or traditional SysVinit) during system startup and shutdown. It parses the LSB (Linux Standard Base) headers within the init scripts to identify dependencies (Required-Start, Required-Stop, Should-Start, Should-Stop, Provides).
Based on these dependencies, startpar constructs a dependency graph. It then executes init scripts that have no unmet dependencies. As dependencies are satisfied, other scripts become eligible for execution. This allows for multiple services to start concurrently, reducing the overall time required for system initialization or termination.
It's important to note that startpar relies on the correct and complete definition of dependencies within the init scripts. Incorrect or missing dependency information can lead to incorrect execution order and potentially system instability. Therefore, properly configured LSB headers are crucial for its successful operation.
CAVEATS
Incorrectly configured LSB headers in init scripts can lead to dependency resolution failures and potentially unstable system behavior. startpar is largely superseded by systemd on modern systems.
RETURN CODES
startpar returns 0 on success. Non-zero return codes indicate errors during execution, such as init scripts failing or timeouts occurring.
HISTORY
startpar was developed to improve system boot times by enabling parallel execution of init scripts, a significant advancement over the sequential execution used by traditional SysVinit. It aimed to leverage the growing capabilities of multi-core processors. While it was widely adopted in some distributions, the rise of systemd, which incorporates parallelization and dependency management directly into the init system, has largely superseded startpar.