lsbinstall

Name

lsbinstall -- installation tool for various types of data

Synopsis

/usr/lib/lsb/lsbinstall [-c | --check | -r | --remove] -t type | --type=type operand...

Description

The lsbinstall command may be used to install certain types of files into system specific locations. This command may be used during a package post installation script to add package specific data to system wide repositories. A user may need appropriate privilege to invoke lsbinstall.

If the -c or --check option is specified, lsbinstall shall test to see if there is an existing object of the type specified already installed. If there is, lsbinstall shall print a message to its standard output and immediately exit with a status of zero. If there is no object of the type and name specified already installed, lsbinstall shall exit with a non-zero status and take no further action.

Note: The format of the message is defined only when the --type=init option is specifed.

If the -r or --remove is specified, the named object of the specified type shall be removed from the system.

Object Types

The -t type or --type=type option shall support at least the following types:

init 

install an init script into the system specific location. There shall be one operand, that names an init script file. On success, a name suitable for use with the install_initd and remove_initd commands shall be printed to the standard output. See also Installation and Removal of Init Scripts.

profile 

install a profile script into a system specific location. There shall be one operand, that names a profile shell script. The behavior is unspecified if this name does not have the suffix .sh. The sh utility shall read and execute commands from all such profile shell scripts when invoked as an interactive login shell, or if the -l (the letter ell) is specified (see Shell Invocation).

service 

ensure a service name and number pair is known to the system service database. When installing, there must be at least two operands. The first operand shall have the format %d/%s with the port number and protocol values (e.g. 22/tcp), and the second operand shall be the name of the service. Any subsequent operands provide aliases for this service. If any of the -r, --remove, -c or --check options are specified, there shall be a single operand identifiying the port and protocol values (with the same format as above).

inet 

add an entry to the system's network super daemon configuration. If none of the -r, --remove, -c or --check options are specified, the first operand shall have the format:

"%s:%s:%s:%s:%s:%s"
Otherwise, the first operand shall have the format
"%s:%s"
The fields in the first operand have the following meaning, in order:

svc_name 

The name of this service. If the name does not contain a /, this should match the name of an already installed service (see also getservbyname()). If the name contains a / character, the behavior is unspecified.

Rationale: This version of the LSB does not specify the getrpcbyname() nor the existence or format of the /etc/rpc file. Therefore, installation of RPC based services is not specified at this point. A future version of this specification may require names containing a / character to be Remote Procedure Call based services.

protocol 

The name of a protocol. The name shall be one of those listed in /etc/protocols. If this attribute is not specified (i.e. a null value is passed), the system shall use an implementation defined default protocol.

socket_type 

One of the following values:

stream 

the service will use a stream type socket.

dgram 

the service will use a datagram type socket. This field is not required for the -c, --check, -r, or --remove options.

seqpacket 

the service will use a sequenced packet type socket. This field is not required for the -c, --check, -r, or --remove options.

wait_flag 

If the value of this attribute is wait, once the service is started, no further requests for that service will be handled until the service exits. If the value is nowait, the network super daemon shall continue to handle further requests for the given service while that service is running.

Note: If the service has the socket_type attribute set to dgram, the wait_flag attribute should be set to wait, since such services do not have any distinction between the socket used for listening and that used for accepting.

This field is not required for the -c, --check, -r, or --remove options.

user[.group] 

The name of a user from the user login database, optionally followed by the name of a group from the group database. The service started to handle this request shall run with the privileges of the specified user and group. This field is not required for the -c, --check, -r, or --remove options.

server [arg ...] 

The name of a program to run to handle the request, optionally followed by any arguments required. The server name and each of its arguments is separated by whitespace. This field is not required for the -c, --check, -r, or --remove options.

If the implementation supports additional controls over services started through the inet super daemon, there may be additional, implementation-defined, operands.

Rationale: Systems that use the xinetd super daemon may support additional controls such as IP address restrictions, logging requirements, etc. The LSB does not require these additional controls. However, it was believed to be of sufficient benefit that implementations are granted permission to extend this interface as required.

crontab 

Install a crontab into the system specific location. There shall be one operand, that names a crontab file. See Cron Jobs.

man 

Install a manual page into the appropriate system manual repository.

Examples

lsbinstall --type=profile myco.com-prod.sh

Install the profile shell script for myco.com-prod.sh.

lsbinstall --check --type=profile myco.com-prod.sh

Test to see if the profile shell script for myco.com-prod.sh is installed correctly.

Exit Status

If the -c or --check option is specified, lsbinstall shall exit with a zero status if an object of the specified type and name is already installed, or non-zero otherwise. Otherwise, lsbinstall shall exit with a zero status if the object with the specified type and name was successfully installed (or removed if the -r or --remove option was specified), and non-zero if the installation (or removal) failed. On failure, a diagnostic message shall be printed to the standard error file descriptor.