summaryrefslogtreecommitdiffabout
path: root/doc
authorSergey Poznyakoff <gray@gnu.org.ua>2016-03-01 15:12:34 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-03-01 15:12:34 (GMT)
commit4b214cf7c9c76532dc17cc7b1be844473b80b885 (patch) (side-by-side diff)
tree2bd26ab5ee7e38d7546c2877a8114903c45913eb /doc
parent0e768e8edeaa14a83bb8de9fd887ba7ffa9635d3 (diff)
downloadpies-4b214cf7c9c76532dc17cc7b1be844473b80b885.tar.gz
pies-4b214cf7c9c76532dc17cc7b1be844473b80b885.tar.bz2
Improve documentation
* doc/Makefile.am (check-sub-config): Fix regexps. * doc/pies.texi: Document init operation.
Diffstat (limited to 'doc') (more/less context) (ignore whitespace changes)
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/pies.texi624
2 files changed, 557 insertions, 69 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index ce7ce64..5452ee4 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -53,7 +53,7 @@ check-config:
$(info_TEXINFOS)
check-sub-config:
- @sed -n '/pies_keywords\[\] *= *{/,/^}/{p}' ../src/pies.c|tr '\n{' ' \n'|sed -n '/grecs_type_section/s/"\([^"]*\)".*grecs_type_section,[^,]*,[^,]*,[^,]*,[^,]*, *\(.*\) *}.*/\1 \2/p' | \
+ @sed -n '/pies_keywords\[\] *= *{/,/^}/{p}' ../src/pies.c|tr '\n{' ' \n'|sed -n '/grecs_type_section/s/"\([^"]*\)".*grecs_type_section,[^,]*,[^,]*,[^,]*,[^,]*,[^,]*, *\(.*\) *}.*/\1 \2/p' | \
while read ident kw; do \
$(CHECK_DOCS) "$$ident configuration statements" \
"/$$kw"'\[\] *= *{/,/^}/s/[ \t]*{ *"\([^,"]*\)".*/\1/pg' \
diff --git a/doc/pies.texi b/doc/pies.texi
index 39a2694..51eac43 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -41,18 +41,12 @@ Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
-Copyright @copyright{} 2005-2014 Sergey Poznyakoff
+Copyright @copyright{} 2005-2016 Sergey Poznyakoff
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``GNU Pies Manual'',
-and with the Back-Cover Texts as in (a) below. A copy of the license
-is included in the section entitled ``GNU Free Documentation License''.
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
-Software Foundation raise funds for GNU development.''
+Invariant Sections, and no specific Front-Cover and Back-Cover texts.
@end copying
@titlepage
@@ -81,11 +75,13 @@ documents @command{pies} Version @value{VERSION}.
@end ifnottex
@menu
-* Intro::
-* Dependencies::
-* Pies Configuration File::
-* Pies Debugging::
-* Configuration Examples::
+* Intro:: Introduction to Process Management with @command{Pies}.
+* Dependencies:: Inter-process dependencies.
+* Pies Configuration File:: Configuration Files of Various Syntaxes.
+* Pies Debugging:: Debugging @command{Pies}.
+* Piesctl:: Communication with Running @command{pies} Instances.
+* Init Process:: @command{Pies} as Parent of All Processes.
+* Configuration Examples:: Examples of Configuration Files.
* Command Line Usage::
* Invocation::
* Reporting Bugs::
@@ -151,34 +147,37 @@ Configuration Examples
@cindex component
The name @command{pies} (pronounced @samp{p-yes}) stands for
@samp{Program Invocation and Execution Supervisor}. This utility
-starts and controls execution of external programs, called
-@dfn{components}. Each component is a stand-alone program, which is
-executed in the foreground. Upon startup, @command{pies} reads the list
-of components from its configuration file, starts them, and remains in
-the background, controlling their execution. When any of the components
-terminates, @command{pies} restarts it. Its configuration allows to
-specify actions other than simple restart, depending on the exit code
-of the component.
+starts and controls execution of external programs. In this document
+these programs will be referred to as @dfn{components}. Each
+component is a stand-alone program, which is executed in the
+foreground.
+
+ Upon startup, @command{pies} reads the list of components
+from its configuration file, starts them, and remains in the
+background, controlling their execution.
The standard output and standard error streams of a component can be
redirected to a file or to an arbitrary @command{syslog} channel.
-@anchor{init-style}
-@cindex init-style components
- This way of operation applies to @dfn{init-style}
-components, called so because of the similarity with the
-@command{init} process manager. @command{Pies} is also able to handle
-components that receive input on their @samp{stdin} and send reply to
-@samp{stdout}. Such components are called @dfn{inetd-style}
-components.
+ The way of handling each component, and in particular the action to
+be taken upon its termination is determined by the component's side.
+
+@anchor{respawn}
+@cindex respawn components
+ A @dfn{respawn} component is restarted each time it terminates. If
+it terminates too often, @command{pies} puts it in sleep mode for
+certain time and logs that fact. This prevents badly configured
+components from taking too much resources and allows administrator to
+take measures in order to fix the situation. More specific action can
+be configured, depending on the exit code of the component.
@anchor{inetd-style}
@cindex inetd-style components
- Inetd-style components are not executed right after @command{pies}
+ @dfn{Inetd}-style components are not executed right after @command{pies}
startup. Instead, @command{pies} opens a socket for each of them and
listens for connections on these sockets. When a connection arrives,
it decides what component the socket corresponds to, and invokes this
-component to handle that connection. In this case, the connection is
+component to handle the connection. In this case, the connection is
bound to component's @samp{stdin} and @samp{stdout} streams. The
@samp{stderr} stream can be redirected to a file or to syslog, as
described above. This mode of operation is similar to that of
@@ -201,13 +200,12 @@ handling of the socket is the responsibility of the component itself.
@anchor{accept-style}
@cindex accept-style components
- The last flavor of @command{pies} components are @dfn{accept-style}
-components, which are handled basically as @samp{inetd-style} ones,
-except that after binding to the socket @command{pies} immediately
-starts the component, without waiting for an actual connection.
+ The last flavor are @dfn{accept-style} components, which are handled
+basically as @samp{inetd-style} ones, except that after binding to the
+socket @command{pies} immediately starts the component, without
+waiting for an actual connection.
- Any number of components of all three styles can be handled
-simultaneously.
+ Any number of components of all types can be handled simultaneously.
Components are started in the order of their appearance in the
configuration file and terminated in reverse order. The same
@@ -265,10 +263,23 @@ configuration files in its native format. This, however, can be
changed by using the @option{--syntax=@var{format}} command line
option. This option instructs @command{pies} that any configuration
files given after it have are written in the specified @var{format}.
-Valid formats are: @samp{pies}, @samp{inetd} and @samp{meta1}, which
-stand for pies native format, inetd-style configuration files
-(@pxref{inetd.conf}) and MeTA1-style configuration files. The
-configuration file format set by the @option{--syntax} option remains
+Valid formats are:
+
+@table @samp
+@item pies
+@command{Pies} native configuration file format.
+
+@item inetd
+@command{Inetd}-style configuration format.
+
+@item meta1
+MeTA1-style format.
+
+@item inittab
+Format of the @file{/etc/inittab} file (@pxref{Init Process}).
+@end table
+
+The configuration file format set by the @option{--syntax} option remains
in effect for all @option{--config-file} options that follow it, up to
the end of the command line or the next occurrence of the
@option{--syntax} option. This means that you can instruct
@@ -687,13 +698,13 @@ The following are the basic statements which are allowed within the
@code{component} block:
@deffn {Config: component} mode @var{mode}
- Declare the type (style) of the component. Accepted values for
-@var{mode} are:
+ Declare the type (style) of the component. Following are the basic
+values for @var{mode}:
@table @asis
@item exec
-@itemx wait
- Define an @samp{init-style} component (@pxref{init-style}). This is
+@itemx respawn
+ Define a @samp{respawn} component (@pxref{respawn}). This is
the default.
@item inetd
@@ -707,6 +718,67 @@ the default.
@item accept
Define a @samp{accept-style} component (@pxref{accept-style}).
@end table
+
+ When run as init process (@pxref{Init Process}), the following
+@var{mode}s are also allowed:
+
+@table @asis
+@item boot
+ The process will be executed during system boot. The
+@samp{runlevel} settings are ignored.
+
+@item bootwait
+ The process will be executed during system boot. No other
+components will be started until it has terminated. The
+@samp{runlevel} settings are ignored.
+
+@item ctrlaltdel
+ The process will be executed when @command{pies} receives the SIGINT
+signal. Normally this means that the CTRL-ALT-DEL combination has
+been pressed on the keyboard.
+
+@item 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.
+
+@item once
+ The process will be executed once when the specified runlevel is
+entered.
+
+@item ondemand
+ The process will be executed when the specified @dfn{ondemand}
+runlevel is called (@samp{a}, @samp{b} and @samp{c}). No real
+runlevel change will occur (@pxref{Ondemand runlevels}).
+The process will remain running accross any eventual runlevel changes
+and will be restarted whenever it terminates, similarly to
+@code{respawn} components.
+
+@item powerfail
+ The process will be executed when the power goes down. @command{Pies}
+will not wait for the process to finish.
+
+@item powerfailnow
+ The process will be executed when the power is failing and the
+battery of the external UPS is almost empty.
+
+@item powerokwait
+ The process will be executed as soon as @command{pies} is informed that
+the power has been restored.
+
+@item powerwait
+ The process will be executed when the power goes down. @command{Pies}
+will wait for the process to finish before continuing.
+
+@item sysinit
+ The process will be executed during system boot, before any @code{boot}
+or @code{bootwait} entries. The @samp{runlevel} settings are ignored.
+
+@item wait
+ The process will be started once when the specified runlevel is
+entered. @command{Pies} will wait for its termination before starting
+any other processes.
+@end table
@end deffn
@deffn {Config: component} program @var{name}
@@ -790,15 +862,11 @@ process instead.
@end table
@end deffn
-@deffn {Config: component} acl @{ @dots{} @}
-Set access control list for this component. @xref{ACL}, for a
-detailed description of access control lists.
-@end deffn
-
The following subsections describe the rest of @samp{component}
substatements.
@menu
+* Access Control::
* Prerequisites::
* Component Privileges::
* Resources::
@@ -810,6 +878,10 @@ substatements.
* Component Syntax Summary::
@end menu
+@node Access Control
+@subsection Access Control
+@WRITEME
+
@node Prerequisites
@subsection Component Prerequisites
@cindex declaring prerequisites
@@ -1226,6 +1298,31 @@ component. It is equivalent to the maximum number of simultaneously
opened connections.
@end deffn
+@deffn {Config: component} max-instances-message @var{text}
+Text to send back if @code{max-instances} is reached. This is valid
+only for TCP sockets.
+@end deffn
+
+@deffn {Config: component} max-ip-connections @var{number}
+Miximum number of connections that can be opened simultaneously from a
+single IP address.
+@end deffn
+
+@deffn {Config: component} max-ip-connections-message @var{text}
+Textual message to send in reply to an incoming TCP connection from the IP
+address that has already reached @code{max-ip-connections} limit.
+@end deffn
+
+@deffn {Config: component} acl @{ @dots{} @}
+Set access control list for this component. @xref{ACL}, for a
+detailed description of access control lists.
+@end deffn
+
+@deffn {Config: component} access-denied-message @var{text}
+Textual message to send in reply to an incoming TCP connection that
+has been denied by ACL settings.
+@end deffn
+
@menu
* builtin:: Built-in Inetd Services
* TCPMUX:: TCPMUX Services
@@ -1557,11 +1654,39 @@ component @var{tag} @{
# @xref{Inetd-Style Components, max-instances}.
max-instances @var{number};
+ # @r{For @samp{inetd} components:}
+ # @r{Text to send back if @code{max-instances} is reached.}
+ # @xref{Inetd-Style Components, max-instances-message}.
+ max-instances-message @var{text};
+
# @r{Maximum number of times an inetd component can be invoked in}
# @r{one minute.}
# @xref{Inetd-Style Components, max-rate}.
max-rate @var{number};
-
+
+ # @r{For @samp{inetd} components:}
+ # @r{Max. number of simultaneous connections from a single IP address.}
+ # @xref{Inetd-Style Components, max-ip-connections}.
+ max-ip-connections @var{number};
+
+ # @r{For @samp{inetd} components:}
+ # @r{Text to send back if @code{max-ip-connections} is reached.}
+ # @xref{Inetd-Style Components, max-ip-connections-message}.
+ max-ip-connections-message @var{text};
+
+ # @r{For @samp{inetd} components:}
+ # @r{Text to send back if access is denied by ACL.}
+ # @xref{Inetd-Style Components, access-denied-message}.
+ access-denied-message @var{text};
+
+ # @r{ACL for administrative access to this component.}
+ # @xref{Access Control}.
+ admin-acl @{ @dots{} @}
+
+ # @r{ACL for read-only access to this component.}
+ # @xref{Access Control}.
+ list-acl @{ @dots{} @}
+
# @r{ACL for this component.}
# @xref{ACL}.
acl @{ @dots{} @}
@@ -2176,14 +2301,6 @@ name (@pxref{instances}). Usually, it is @samp{pies}.
The @dfn{PID file}. It keeps the PID number of the running
@command{pies} instance.
-@item @file{@var{instance}.ctl}
-The @dfn{control file}. This file is used by @command{pies
---restart-component} to pass control requests to the running
-@command{pies} instance.
-
-@item @file{@var{instance}.stat}
-The @dfn{statistics file}. Used by @command{pies --status}.
-
@item @file{@var{instance}.qotd}
The @dfn{Quotation-of-the-day file}. It is used by the @samp{qotd}
built-in service (@pxref{qotd}).
@@ -2192,20 +2309,12 @@ built-in service (@pxref{qotd}).
The following statements allow to redefine state file names.
Use them only if the defaults do not suit your needs, and niether
the @code{state-directory} statement nor the @option{--instance}
-can help:
+option can help:
@deffn {Config} pidfile @var{file}
Sets the PID file name.
@end deffn
-@deffn {Config} control-file @var{file}
-Sets the control file name.
-@end deffn
-
-@deffn {Config} stat-file @var{file}
-Sets the statistics file name.
-@end deffn
-
@deffn {Config} qotd-file @var{file-name}
Sets the name of the @samp{quotation-of-the-day} file.
@end deffn
@@ -2253,6 +2362,382 @@ source-info yes;
This feature is designed for @command{pies} developers.
@end deffn
+@node Piesctl
+@chapter Communicating with Running @command{pies} Instances
+@WRITEME
+
+@node Init Process
+@chapter Init -- parent of all processes
+@cindex init
+ @command{Pies} can be executed directly by the kernel as a program
+responsible for starting all other processes (a process with PID 1).
+In this case it becomes also the parent of all processes whose natural
+parents have died and is responsible for reaping those when they die.
+
+ When invoked this way, @command{pies} reads its configuration from
+two files: @file{/etc/inittab} and @file{/etc/pies.init}. The former has
+traditional syntax (@pxref{inittab}) and is retained for compatibility
+with another @samp{init} daemons, and the latter is in native
+@command{pies} format (@pxref{Syntax}). Either of the files or even
+both of them can be missing.
+
+ The startup process passes through several states. Transition between
+states is controlled by @dfn{runlevel}, which also defines the set of
+components that must be executed. Startup states are:
+
+@table @asis
+@item sysinit
+System initialization state. This state marks the beginning of the
+startup process. Only root partition is mounted, and is usually
+read-only. @command{Pies} uses console to output diagnostic messages.
+
+Normally, the configuration instructs @command{pies} to execute at
+this point the system initialization script, which checks and mounts the
+necessary local file systems, initializes devices and loads kernel modules.
+
+The system then passes to @samp{boot} state, unless the default
+runlevel is @samp{S}, in which case the @samp{single} state is selected.
+
+@item boot
+Upon entering the @samp{boot} state, @command{pies} attempts to log
+the @samp{reboot} login record into the system @file{utmp}/@file{wtmp}
+files and executes entries marked with @code{boot} and @code{bootwait}
+types. It then enters the @samp{normal} state.
+
+@item single
+This is a fallback state for single-user system. It is entered only
+if the @samp{S} runlevel has been selected initially. Normally, this
+state is used for system maintenance. The configuration usually
+provides a component which executes a single-user shell when entering
+this state. If it does not, @command{pies} executes @samp{/sbin/sulogin}.
+
+@item normal
+Upon entering this state, @command{pies} assumes that components
+executed previously have brought the system to such condition where
+normal communication means can already be used. This means that the
+file systems have been mounted read-write and the @command{syslog}
+daemon is operating. Therefore @command{pies} opens its communication
+channels and redirects its diagnostic output to syslog facility
+@samp{daemon}.
+
+Then it starts components scheduled for the default runlevel and
+begins its normal operation.
+@end table
+
+@command{Pies} communication channels are:
+
+@table @file
+@item /dev/initctl
+A FIFO file for communication using legacy protocol (using @command{telinit}).
+
+@item /dev/init.ctl
+UNIX socket for communication using @command{piesctl}.
+@end table
+
+@menu
+* Runlevels::
+* Init Process Configuration::
+* Init Command Line::
+* piesctl telinit::
+* Init Environment::
+@end menu
+
+@node Runlevels
+@section Runlevels
+
+Runlevel determines the set of components to be run in normal state.
+It is a decimal digit from @samp{0} to @samp{9} or letter @samp{S}.
+Traditionally, runlevels are assigned as follows:
+
+@table @asis
+@item 0
+System halt.
+@item 1
+@itemx S
+Single user mode.
+@item 3
+Multiuser mode.
+@item 4
+Multiuser with X11.
+@end table
+
+@anchor{Ondemand runlevels}
+Additionally, three special runlevels @samp{a}, @samp{b} and @samp{c}
+can be used to start @dfn{on-demand} components without actually
+changing the runlevel. Once started, on-demain components persist
+through eventual runlevel changes.
+
+@node Init Process Configuration
+@section Init Process Configuration
+@anchor{inittab}
+The two configuration files are read in this order:
+@file{/etc/inittab} first, then @file{/etc/pies.init}. The
+@file{/etc/inittab} file is a simple line-oriented file. Empty lines
+and lines beginning with @samp{#} are ignored (except if @samp{#} is
+followed by the word @samp{pies}, see below). Non-empty lines
+consist of 4 fields separated by colons:
+
+@example
+@var{id}:@var{runlevels}:@var{mode}:@var{command}
+@end example
+
+@noindent
+where
+
+@table @var
+@item id
+Component identifier. A string uniquely identifying this component.
+
+@item runlevels
+List of the runlevels for which the component should be run.
+Runlevels are listed as a contiguous string of characters, without
+any whitespace or delimiters.
+
+@item mode
+Component execution mode.
+
+@item command
+Command to be executed and its arguments.
+@end table
+
+Component execution modes are:
+
+@table @asis
+@item respawn
+ The basic execution mode. A @dfn{respawn} component is
+restarted each time it terminates. If it is restarted more than 10
+times in 2 minutes, @command{pies} puts it in @dfn{sleeping} state for
+the next 5 minutes.
+
+@item off
+ Disabled component. The entry is ignored.
+
+@item boot
+ The process will be executed during system boot. The
+@samp{runlevel} settings are ignored.
+
+@item bootwait
+ The process will be executed during system boot. No other
+components will be started until it has terminated. The
+@samp{runlevel} settings are ignored.
+
+@item sysinit
+ The process will be executed during system boot, before any @code{boot}
+or @code{bootwait} entries. The @samp{runlevel} settings are ignored.
+
+@item once
+ The process will be executed once when the specified runlevel is
+entered.
+
+@item wait
+ The process will be started once when the specified runlevel is
+entered. @command{Pies} will wait for its termination before starting
+any other processes.
+
+@item ctrlaltdel
+ The process will be executed when @command{pies} receives the SIGINT
+signal. Normally this means that the CTRL-ALT-DEL combination has
+been pressed on the keyboard.
+
+@item 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.
+
+@item ondemand
+ The process will be executed when the specified @dfn{ondemand}
+runlevel is called (@samp{a}, @samp{b} and @samp{c}). No real
+runlevel change will occur (@pxref{Ondemand runlevels}).
+The process will remain running accross any eventual runlevel changes
+and will be restarted whenever it terminates, similarly to
+@code{respawn} components.
+
+@item powerfail
+ The process will be executed when the power goes down. @command{Pies}
+will not wait for the process to finish.
+
+@item powerfailnow
+ The process will be executed when the power is failing and the
+battery of the external UPS is almost empty.
+
+@item powerokwait
+ The process will be executed as soon as @command{pies} is informed that
+the power has been restored.
+
+@item powerwait
+ The process will be executed when the power goes down. @command{Pies}
+will wait for the process to finish before continuing.
+@end table
+
+The special mode @samp{initdefault} declares the default runlevel. In
+the @samp{initdefault} entry, the @var{runlevels} field must consist of
+exactly one runlevel character. Rest of fields are ignored. For
+example, the following instructs @command{pies} that the default
+runlevel is @samp{3}:
+
+@example
+id:3:initdefault:
+@end example
+
+If no @samp{initdefault} entry is present, @command{pies} will ask the
+user to input the desired default runlevel upon entering the normal
+state.
+
+Inittab must contain at least one entry with @samp{S} in
+@var{runlevels} field. This entry is used for system maintenance and
+recovery. If it is absent, @command{pies} adds the following default
+entry implicitly:
+
+@example
+~~:S:wait:/sbin/sulogin
+@end example
+
+As an exception to traditional syntax, the @samp{#} followed by the
+word @samp{pies} (with any amount of white space in between) introduce
+a pragmatic comment that modifies the behavior of the configuration
+parser. The following such comments are understood:
+
+@table @asis
+@item #pies pragma debug @var{n}
+Set debugging level @var{n} (a decimal number). @xref{Pies
+Debugging}.
+
+@item #pies pragma next @var{syntax} @var{file}
+After parsing @file{/etc/inittab}, read configuration from file
+@var{file}, assuming @var{syntax} (@pxref{config syntax}). Multiple
+@samp{next} pragmas are allowed, the named files will be processed in
+turn.
+
+The default set up is equivalent to specifying
+
+@example
+#pies pragma next pies /etc/pies.init
+@end example
+
+@item #pies pragma stop
+Stop parsing after this line. The remaining material is ignored.
+@end table
+
+Both the traditional @file{/etc/inittab} and pies-native
+@file{/etc/pies.init} files are entirely equivalent, excepting that,
+naturally, the latter is more flexible and gives much more
+possibilities in defining the system behavior. The inittab entry
+discussed above is equivalent to the following statement in
+@file{pies.init} file:
+
+@example
+component @var{id} @{
+ mode @var{mode};
+ runlevels @var{runlevels};
+ command @var{command};
+@}
+@end example
+
+If both @file{/etc/inittab} and @file{/etc/pies.init} are present, the
+latter can declare components with the same @var{id} as the ones
+declared in the former. In that case, the two entries will be merged,
+the latter one overriding the former. Thus, @file{/etc/pies.init} can
+be used to complement definitions in @file{inittab}. Consider, for
+example the following inittab entry:
+
+@example
+upd:3:respawn:/usr/libexec/upload
+@end example
+
+If @file{pies.init} contains the following:
+
+@example
+component upd @{
+ user nobody;
+ stderr syslog local1;
+@}
+@end example
+
+@noindent
+the result will be equivalent to:
+
+@example
+component upd @{
+ mode respawn;
+ runlevels 3;
+ command /usr/libexec/upload;
+ user nobody;
+ stderr syslog local1;
+@}
+@end example
+
+@node Init Command Line
+@section Init Command Line
+
+The runlevel to run in can be given as argument in the command line:
+
+@example
+/sbin/pies 1
+@end example
+
+Apart from this, the following command line arguments are recognized:
+
+@table @option
+@item -s
+@itemx single
+Initialize default runlevel @samp{S}.
+
+@item -b
+@itemx emergency
+Run emergency shell @command{/sbin/sulogin}, prior to initialization.
+@end table
+
+@node piesctl telinit
+@section piesctl telinit
+
+@deffn {Telnit Runlevel} piesctl telinit runlevel
+Report the runlevel and state of the process 1.
+@end deffn
+
+@deffn {Telnit Runlevel} piesctl telinit runlevel @var{n}
+Switch to runlevel @var{n}.
+@end deffn
+
+@deffn {Telnit Env} piesctl telinit environ list [@var{NAME}]
+List the environment. If @var{NAME} is given, list only the value of
+that variable.
+@end deffn
+
+@deffn {Telinit Env} piesctl telinit environ set @var{NAME}=@var{VALUE}
+Set variable @var{NAME} to @var{VALUE}. The environment is capable to
+hold at most 32 variables.
+@end deffn
+
+@deffn {Telinit Env} piesctl telinit environ unset @var{NAME}
+Unset variable @var{NAME}.
+@end deffn
+
+@node Init Environment
+@section Init Environment
+
+Programs run from @command{pies} init process inherit a basic
+environment consisting of the following variables:
+
+@table @option
+@item PREVLEVEL=@var{L}
+Previous runlevel, or letter @samp{N} if the runlevel hasn't been
+changed since startup.
+
+@item RUNLEVEL=@var{L}
+Current runlevel.
+
+@item CONSOLE=@var{device}
+Pathname of the console device file.
+
+@item INIT_VERSION="GNU Pies @value{VERSION}"
+Version of @command{pies}.
+
+@item PATH=/bin:/usr/bin:/sbin:/usr/sbin
+@end table
+
+Once the system is booted up, the environment can be controlled using
+the @command{piesctl telinit environ} command.
+
@node Configuration Examples
@chapter Configuration Examples
In this section we provide several examples of working @command{pies}
@@ -2651,6 +3136,9 @@ Native @command{pies} configuration. @xref{Pies Configuration File}.
@item meta1
@samp{meta1}-style configuration files. @xref{include-meta1}.
+
+@item inittab
+@samp{Inittab} file. @xref{Init Process}.
@end table
@xref{config syntax}, for a detailed description of this option.

Return to:

Send suggestions and report system problems to the System administrator.