'\"macro stdmacro .\" .\" Copyright (c) 2024 Ken McDonell. All Rights Reserved. .\" .\" This program is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 2 of the License, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" for more details. .\" .\" .TH RUNASPCP 1 "PCP" "Performance Co-Pilot" .SH NAME \f3runaspcp\f1 \- execute a shell command as the user ``pcp'' .SH SYNOPSIS .B $PCP_BINADM_DIR/runaspcp [\f3\-s\f1 \f2shell\f1] command .SH DESCRIPTION .B runaspcp runs the single argument .I command as the user .B $PCP_USER and group .B $PCP_GROUP (both from .IR /etc/pcp.conf ). .PP The .I command is run by .BR sh (1) by default, else .I shell from the .B \-s (or .BR \-\-shell) command line argument. .PP Normally .B runaspcp is used from the PCP ``init'' scripts that are launched as ``root'' but need to downgrade their privileges when running some PCP daemons as the ``pcp'' user. .B runaspcp provides a portable solution for platforms where neither .BR setpriv (1) nor .BR runuser (1) is available, although these alternates will be used in preference to .B runaspcp if they are installed. .PP The \fB\-?\fR, \fB\-\-help\fR option displays a usage message. .SH DIAGNOSTICS The exit status is 1 if .B runaspcp cannot change user or group, or cannot execute the shell, else the exit status of .IR command . .SH SEE ALSO .BR runuser (1), .BR setpriv (1) and .BR sh (1).