=head1 NAME

openhpid - HPI instance to which multiple clients can connect.

=head1 SYNOPSIS

openhpid -c config_file [OPTION]

=head1 DESCRIPTION

The OpenHPI daemon runs as a background process and accepts connections from
remote clients that invoke HPI function calls. The daemon wraps the OpenHPI
library with a sockets-based API that is archicture neutral for all types of
clients.

When you run the daemon, the standard method for locating the OpenHPI
configuration file is used. However, the daemon will accept a configuration
file as a command line option (-c) to override the default file.

A command option (-p)  or environment variable determines the port number the
daemon will listen on for client connections. The default port is 4743.

The daemon creates a PID file in the /var/run subdirectory. This directory is
only writable by the root user. Thus the daemon will fail when run as a normal
user if the PID file location is not overridden.
To override the PID file location you can use the -f command line option.

The client and the daemon do not have to be on the same hardware architecture.
The daemon could be running on a P-series processor and the client running on
an x86-series processor. The client library and daemon use a marshaling
technique to resolve architecture and structure padding conflicts. The user
does not need to concern themselves with architectureal differences between
the client and daemon. The one exception to this rule is 64-bit architectures.
The client and daemon currently cannot resolve differences between 32-bit and
64-bit architectures.

=head1 OPTIONS

=over 4

=item B<-c>, B<--cfg>=I<conf_file>

Sets path/name of the configuration file.
This option is required unless the environment 
variable OPENHPI_CONF has been set to a valid configuration file.

=item B<-v>, B<--verbose>

This option causes the daemon to display verbose
messages. This option is optional.

=item B<-b>, B<--bind>=I<bind_address>

Bind address for the daemon socket.
Also bind address can be specified with
OPENHPI_DAEMON_BIND_ADDRESS environment variable.
No bind address is used by default.

=item B<-p>, B<--port>=I<port>

Overrides the default listening port (4743) of the daemon.
The option is optional.

=item B<-f>, B<--pidfile>=I<pidfile>

Overrides the default path/name for the daemon pid file.
The option is optional.

=item B<-s>, B<--timeout>=I<seconds>

Overrides the default socket read timeout of 30 minutes.
The option is optional.

=item B<-t>, B<--threads>=I<threads>

Sets the maximum number of connection threads.
The default is umlimited.
The option is optional.

=item B<-n>, B<--nondaemon>

Forces the code to run as a foreground process and NOT as a daemon.
The default is to run as a daemon.
The option is optional.

=item B<-6>, B<--ipv6>

The daemon will try to bind IPv6 socket.

=item B<-4>, B<--ipv4>

The daemon will try to bind IPv4 socket (default).
IPv6 option takes precedence over IPv4 option.

=item B<-4 -6>

The daemon will try to bind IPv4 or IPv6 socket.

=back

=head1 ENVIRONMENTAL VARIABLES

All of these environment variables can instead be set in the openhpi.conf
configuration file, except for OPENHPI_DAEMON_PORT and OPENHPI_CONF.

=over 4

=item B<OPENHPI_DAEMON_PORT>=PORT_NUMBER

The port number the host will listen on for clent connections.
Default port is 4743.

=item B<OPENHPI_LOG_ON_SEV>

Valus can be one of: CRITICAL,MAJOR,MINOR,INFORMATIONAL,OK,DEBUG.
Events of this severity or higher will be logged to the domain event log.
The default is MINOR.

=item B<OPENHPI_EVT_QUEUE_LIMIT>=NUMBER

Maximum number of events allowed in a subscribed session's queue.
Default is 10000.

=item B<OPENHPI_DEL_SIZE_LIMIT>=NUMBER

Maximum number of events allowed in the domain event log.
Default is 10000

=item B<OPENHPI_DEL_SAVE>

Set to YES to persist the domain event logs to disk. They will be loaded
in case the daemon restarts. Default is NO.

=item B<OPENHPI_DAT_SIZE_LIMIT>=NUMBER

Maximum number of alarms allowed in the domain alarm table.
Default is unlimited.

=item B<OPENHPI_DAT_USER_LIMIT>=NUMBER

Maximum number of user alarms allowed in the domain alarm table.
Default is unlimited.

=item B<OPENHPI_DAT_SAVE>

Set to YES to persist the domain alarm tables to disk. They will be loaded
in case the daemon restarts. Default is NO.

=item B<OPENHPI_PATH>="/path/to/plugins:/another/path/to/plugins"

This is a colon delimited list of directories used when searching for an
OpenHPI plugin to load. The default is $prefix/lib/openhpi.

=item B<OPENHPI_VARPATH>="/path/to/dir"

This sets the directory used to store openhpi internal data. The domain
event logs and alarm tables are saved there (if configured to) along with
resource ID to entity path mappings.
Default is $prefix/var/lib/openhpi.

=item B<OPENHPI_CONF>="/path/to/configurationg/file"

This is another way of telling the daemon where to find the configuration file.

=back

=head1 SEE ALSO

The following man pages may also be of interest

=over 4

=item B<openhpi>

General information about OpenHPI

=back

=head1 AUTHORS

Authors of this man page:

 Renier Morales (renier@openhpi.org)
 Anton Pak (avpak@users.sourceforge.net)

