Next: , Previous: , Up: Configuration   [Contents][Index]


3.3 The component Statement

Config: component

The component statement defines a new component:

component tag {
  …
}

The component is identified by its tag, which is given as argument to the component keyword. Component declarations with the same tags are merged into a single declaration.

The following are the basic statements which are allowed within the component block:

Config: component: mode mode

Declare the type (style) of the component. Following are the basic values for mode:

exec
respawn

Define a ‘respawn’ component (see respawn). This is the default.

inetd
nostartaccept

Define an ‘inetd-style’ component (see inetd-style).

pass
pass-fd

Define a ‘meta1-style’ component (see meta1-style).

accept

Define a ‘accept-style’ component (see accept-style).

startup

The component is run right after startup. Prior to starting any other components, pies will wait for all startup components to terminate.

shutdown

These components are started as a part of program shutdown sequence, after all regular components have terminated. See shutdown sequence, for a detailed discussion.

When run as init process (see Init Process), the following modes are also allowed:

boot

The process will be executed during system boot. The ‘runlevel’ settings are ignored.

bootwait

The process will be executed during system boot. No other components will be started until it has terminated. The ‘runlevel’ settings are ignored.

ctrlaltdel

The process will be executed when pies receives the SIGINT signal. Normally this means that the CTRL-ALT-DEL combination has been pressed on the keyboard.

kbrequest

The process will be executed when a signal from the keyboard handler is received that indicates that a special key combination was pressed on the console keyboard.

once

The process will be executed once when the specified runlevel is entered.

ondemand

The process will be executed when the specified ondemand runlevel is called (‘a’, ‘b’ and ‘c’). No real runlevel change will occur (see Ondemand runlevels). The process will remain running across any eventual runlevel changes and will be restarted whenever it terminates, similarly to respawn components.

powerfail

The process will be executed when the power goes down. Pies will not wait for the process to finish.

powerfailnow

The process will be executed when the power is failing and the battery of the external UPS is almost empty.

powerokwait

The process will be executed as soon as pies is informed that the power has been restored.

powerwait

The process will be executed when the power goes down. Pies will wait for the process to finish before continuing.

sysinit

The process will be executed during system boot, before any boot or bootwait entries. The ‘runlevel’ settings are ignored.

wait

The process will be started once when the specified runlevel is entered. Pies will wait for its termination before starting any other processes.

Config: component: command string

Command line to run. string is the full command line. Its first word (in the shell sense) is the name of the program to invoke.

Config: component: program name

Full file name of the program to run. When supplied, pies will execute the program name instead of the first word in the command statement. The latter, however, will be passed to the running program as argv[0].

Config: component: flags (flag-list)

Define flags for this component. The flag-list is a comma-separated list of flags. Valid flags are:

disable

This component is disabled, i.e. pies will parse and remember its settings, but will not start it.

nullinput

Do not close standard input. Redirect it from /dev/null instead. Use this option with commands that require their standard input to be open (e.g. pppd nodetach).

precious

Mark this component as precious. Precious components are never disabled by pies, even if they respawn too fast.

shell

Run command as /bin/sh -c "$command". Use this flag if command contains shell-specific features, such as I/O redirections, pipes, variables or the like. You can change the shell program using the program statement. For example, to use Korn shell:

component X {
  flags shell;
  program "/bin/ksh";
  command "myprog $HOME";
}
expandenv

Expand environment variables in the ‘command’ statement prior to running it. When used together with the ‘shell’ flag, this flag produces a warning and has no effect. See Early Environment Expansion, for a detailed discussion.

wait

This flag is valid only for ‘inetd’ components. It has the same meaning as ‘wait’ in inetd.conf file, i.e. it tells pies to wait for the server program to return. See wait.

tcpmux

This is a TCPMUX component. See TCPMUX.

tcpmuxplus

This is a TCPMUX+ component. See TCPMUX.

internal

This is an internal inetd component. See builtin.

sockenv

This inetd component wants socket description variables in its environment. See sockenv.

resolve

When used with ‘sockenv’, the LOCALHOST and REMOTEHOST environment variables will contain resolved host names, instead of IP addresses.

siggroup

This flag affects the behavior of pies when a stopped process fails to terminate within a predefined timeout (see shutdown-timeout. Normally pies would send the ‘SIGKILL’ signal to such a process. If this flag is set, pies would send ‘SIGKILL’ to the process group of this process instead.

Config: component: sigterm sig

Defines signal which should be sent to terminate this component. The default is SIGTERM. The argument sig is either the name of a signal defined in /usr/include/signal.h, or ‘SIG+n’, where n is signal number.

The following subsections describe the rest of ‘component’ substatements.


Next: , Previous: , Up: Configuration   [Contents][Index]