'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH POOLBIND 1M "Feb 9, 2005"
.SH NAME
poolbind \- bind processes, tasks, or projects or query binding of processes to
resource pools
.SH SYNOPSIS
.LP
.nf
\fB/usr/sbin/poolbind\fR \fB-p\fR \fIpoolname\fR \fB-e\fR \fIcommand\fR [\fIarguments\fR]...
.fi

.LP
.nf
\fB/usr/sbin/poolbind\fR \fB-p\fR \fIpoolname\fR [\fB-i\fR \fIidtype\fR] \fIid\fR...
.fi

.LP
.nf
\fB/usr/sbin/poolbind\fR \fB-q\fR \fIpid\fR...
.fi

.LP
.nf
\fB/usr/sbin/poolbind\fR \fB-Q\fR \fIpid\fR...
.fi

.SH DESCRIPTION
.sp
.LP
The \fBpoolbind\fR command allows an authorized user to bind zones, projects,
tasks, and processes to pools. With the \fB-e\fR option (see below), it can
execute a command you specify, placing the executed command in a specified
pool. It can also enable you to query a process to determine which pool a
process is bound to.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-e\fR \fIcommand\fR [\fIarguments\fR...]\fR
.ad
.RS 29n
Executes \fIcommand\fR, bound to the pool you specify with \fB-p\fR.
.RE

.sp
.ne 2
.na
\fB\fB-i\fR \fIidtype\fR\fR
.ad
.RS 29n
This option, together with the \fIidlist\fR arguments, specifies one or more
processes to which the poolbind command is to apply. The interpretation of
\fIidlist\fR depends on the value of \fIidtype\fR. The valid \fIidtype\fR
arguments and corresponding interpretations of \fIidlist\fR are as follows:
.sp
.ne 2
.na
\fB\fIpid\fR\fR
.ad
.RS 10n
\fIidlist\fR is a list of process \fBID\fRs. Binds the specified processes to
the specified pool. This is the default behavior if no idtype is specified.
.RE

.sp
.ne 2
.na
\fB\fItaskid\fR\fR
.ad
.RS 10n
\fIidlist\fR is a list of task IDs. Bind all processes within the list of task
IDs to the specified pool.
.RE

.sp
.ne 2
.na
\fB\fIprojid\fR\fR
.ad
.RS 10n
\fIidlist\fR is a list of project \fBID\fRs. Bind all processes within the list
of projects to the specified pool. Each project \fBID\fR can be specified as
either a project name or a numerical project \fBID\fR. See \fBproject\fR(4).
.RE

.sp
.ne 2
.na
\fB\fIzoneid\fR\fR
.ad
.RS 10n
\fIidlist\fR is a list of zone \fBID\fRs. Bind all processes within the list of
zones to the specified pool. Each zone \fBID\fR can be specified as either a
zone name or a numerical zone \fBID\fR. See \fBzones\fR(5).
.RE

.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIpoolname\fR\fR
.ad
.RS 29n
Specifies the name of a pool to which the specified zone, project, tasks, or
processes are to be bound.
.RE

.sp
.ne 2
.na
\fB\fB-q\fR \fIpid\fR ...\fR
.ad
.RS 29n
Queries the pool bindings for a given list of process \fBID\fRs. If the
collection of resources associated with the process does not correspond to any
currently existing pool, or if there are multiple pools with the set of
resources that the process is bound to, the query fails for that particular
process \fBID\fR.
.RE

.sp
.ne 2
.na
\fB\fB-Q\fR \fIpid\fR ...\fR
.ad
.RS 29n
 Queries the resource bindings for a given list of process IDs. The resource
bindings are each reported on a separate line.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRBinding All Processes
.sp
.LP
The following command binds all processes in projects \fB5\fR and \fB7\fR to
the pool \fBweb_app\fR:

.sp
.in +2
.nf
example# /usr/sbin/poolbind \fB-p\fR web_app \fB-i\fR projid 5 7
.fi
.in -2
.sp

.LP
\fBExample 2 \fRBinding the Running Shell
.sp
.LP
The following command binds the running shell to the pool \fBweb_app\fR:

.sp
.in +2
.nf
 example# /usr/sbin/poolbind \fB-p\fR web_app $$
.fi
.in -2
.sp

.LP
\fBExample 3 \fRQuerying the Pool Bindings
.sp
.LP
The following command queries the bindings to verify that the shell is bound to
the given pool:

.sp
.in +2
.nf
example# /usr/sbin/poolbind \fB-q\fR $$
.fi
.in -2
.sp

.LP
\fBExample 4 \fRQuerying the Resource Bindings
.sp
.LP
The following command queries the bindings to verify that the shell is bound to
the given resources:

.sp
.in +2
.nf
example# /usr/sbin/poolbind \fB-Q\fR $$
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
Requested operation could not be completed.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Invalid command line options were specified.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	 See below.
.TE

.sp
.LP
The invocation is Evolving. The output is Unstable.
.SH SEE ALSO
.sp
.LP
\fBpooladm\fR(1M), \fBpoolcfg\fR(1M), \fBlibpool\fR(3LIB), \fBproject\fR(4),
\fBattributes\fR(5), \fBzones\fR(5)
.sp
.LP
\fI\fR