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

3.2 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:


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


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


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


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


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


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

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


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


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


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.


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.


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


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.


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


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


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


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


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


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:


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


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).


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


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";

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.


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.


This is a TCPMUX component. See TCPMUX.


This is a TCPMUX+ component. See TCPMUX.


This is an internal inetd component. See builtin.


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


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


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.

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

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