#!/bin/bash #------------------------------------------------------------------------------ # Copyright (c) Perforce Software, Inc., 2007-2014. All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1 Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE # SOFTWARE, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. #------------------------------------------------------------------------------ # # Mail to the administrator gets sent here: export MAILTO=REPL_MAILTO export P4USER=REPL_ADMINUSER export P4SERVICEUSER=REPL_SVCUSER export OSUSER=REPL_OSUSER export SDP_VERSION="REPL_SDPVERSION" AWK=awk CUT=cut DF="df -h" GREP=grep ID=id MAIL=mail PS=ps OS=`uname` if [ "${OS}" = "SunOS" ] ; then AWK=/usr/xpg4/bin/awk ID=/usr/xpg4/bin/id MAIL=mailx elif [ "${OS}" = "AIX" ] ; then DF="df -m" fi export AWK export ID export MAIL export DF # Which perforce instance are we configuring? Defaults to 1. export P4INSTANCE=${1:-1} export P4HOME="/p4/${P4INSTANCE}" export TMP=${P4HOME}/tmp export P4TMP=${P4HOME}/tmp export P4ROOT=${P4HOME}/root export P4JOURNAL=${P4HOME}/logs/journal export P4CONFIG=${P4HOME}/.p4config export P4TICKETS=${P4HOME}/.p4tickets export P4SSLDIR=${P4HOME}/ssl export DEPOTS=${P4HOME}/depots export CHECKPOINTS=${P4HOME}/checkpoints export LOGS=${P4HOME}/logs export P4LOG=${LOGS}/log export P4LOGS=$P4HOME/logs export P4CBIN=/p4/common/bin export P4CLIB=/p4/common/lib export PERL5LIB=$P4CLIB:${PERL5LIB:-} export PERLHOME=/p4/common/perl export PYHOME=/p4/common/python export PATH=$P4HOME/bin:$P4CBIN:$PYHOME/bin:$PERLHOME/site/bin:$PERLHOME/bin:$PATH:. export MANPATH=$PERLHOME/site/man:$PERLHOME/man:${MANPATH:-} # P4Proxy Settings export P4PCACHE=$P4HOME/cache # Set KEEPCKPS to the number of checkpoint & journal files and their # corresponding log files to keep. Checkpoints and their log file are # numbered with the same journal counter number. Checkpoints/journals # and their logs are removed when daily_backup.bat or weekly_backup.bat # are run. The live_checkpoint.bat script does not remove. # Set KEEPCKPS=0 to avoid automated cleanup of checkpoints and logs. export KEEPCKPS=7 # Set KEEPLOGS to the number of server logs to keep, counting back from # the most recent. Server logs are numbered with their corresponding # journal counter number, since server logs are rotated when checkpoint # logs are rotated. Keep in mind that if scripts are set to run # more than once per day, this will not correspond to the number # of days, just the number of iterations of script calls. # KEEPLOGS affects all log files other than checkpoint logs, which are # governed by KEEPCKPS. # Set KEEPLOGS=0 to avoid automated cleanup of old server logs. export KEEPLOGS=31 # Don't change this; change or comment the above as needed export P4BIN=${P4HOME}/bin/p4_${P4INSTANCE} export P4DBIN=${P4HOME}/bin/p4d_${P4INSTANCE} export P4PBIN=${P4HOME}/bin/p4p_${P4INSTANCE} export P4BROKERBIN=${P4HOME}/bin/p4broker_${P4INSTANCE} export P4WEBBIN=${P4HOME}/bin/p4web_${P4INSTANCE} # Define *_VERSION values. These will look like "2014.1.899321" # or "2015.1_BETA.903064". For example, to specify behavior specific # to 2014.1 or later P4D, test with [[ "$P4D_VERSION" > "2014.1" ]]. # That expression will be true 2014.1 and any subsequent release. Since # the values contain the patch number, all releases of "2014.1.*" will # be greater than the string "2014.1", so "greater than or equal to" is # implied. [[ -x $P4BIN ]] && export P4_VERSION=$($P4BIN -V|$GREP ^Rev.|$CUT -d '/' -f 3).$($P4BIN -V|$GREP ^Rev.|$CUT -d '/' -f 4|$CUT -d ' ' -f 1) [[ -x $P4DBIN ]] && export P4D_VERSION=$($P4DBIN -V 2>/dev/null|$GREP ^Rev.|$CUT -d '/' -f 3).$($P4DBIN -V 2>/dev/null|$GREP ^Rev.|$CUT -d '/' -f 4|$CUT -d ' ' -f 1) # Set version values for optional executables. [[ -x $P4PBIN ]] && export P4P_VERSION=$($P4PBIN -V|$GREP ^Rev.|$CUT -d '/' -f 3).$($P4PBIN -V|$GREP ^Rev.|$CUT -d '/' -f 4|$CUT -d ' ' -f 1) [[ -x $P4BROKERBIN ]] && export P4BROKER_VERSION=$($P4BROKERBIN -V|$GREP ^Rev.|$CUT -d '/' -f 3).$($P4BROKERBIN -V|$GREP ^Rev.|$CUT -d '/' -f 4|$CUT -d ' ' -f 1) [[ -x $P4WEBBIN ]] && export P4WEB_VERSION=$($P4WEBBIN -V|$GREP ^Rev.|$CUT -d '/' -f 3).$($P4WEBBIN -V|$GREP ^Rev.|$CUT -d '/' -f 4|$CUT -d ' ' -f 1) export P4_VARS_LOADED=1 # Sets instance specific vars. Last so that the caller sees the error. if [ -f "${P4HOME}/cfg/instance_vars" ] ; then . ${P4HOME}/cfg/instance_vars fi
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 11477 | Russell C. Jackson (Rusty) |
Updated to use /usr/bin/env python Added workshop header. Changed cfg to config. |
||
#1 | 11474 | Russell C. Jackson (Rusty) |
Had to move the cfg directory to the metadata volume and link it under the instance directory to provide the proper separation in a shared volume environment. The instance specific vars cannot be in a shared directory since they need to be different on each node using the shared volume. Since the files moved back to the instance directory, I changed the names back to: instance_vars p4review.cfg to keep things simple. Also moved p4_vars.template to SDP/Server/Unix/p4/common/cfg so that it doesn't get copied to the /p4/common/bin folder. Plus, it makes more sense for it to be in that directory in the SDP structure. |
||
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/p4_vars.template | |||||
#4 | 11466 | Russell C. Jackson (Rusty) |
Initial work to simplify p4_vars and remove cluster stuff. Testing of named instances surfaced some bugs that are in prod sdp, now fixed in dev. Added three triggers from RCJ SDP Moved p4review.cfg into the new /p4/common/cfg to go along with the instance_vars files. mkdirs.sh now generates an instance_p4review.cfg as well. Removed incremental p4verify to clean up a bit. It didn't support replicas and was really never used. All port settings now live in <instance>_vars file. You set what you want the ports to be in mkdirs.sh. There is no more fancy logic to try to guess what the port should be. You set it, and that is what it is. Remaining to do is to updated scripts to not need p4master_run. Saved that work for later since this is tested and works. |
||
#3 | 10994 | Robert Cowham | Catchup from Main | ||
#2 | 10867 | C. Thomas Tyler | Merge Down: Rereshed 'dev' from 'main'. | ||
#1 | 10638 | C. Thomas Tyler | Populate perforce_software-sdp-dev. | ||
//guest/perforce_software/sdp/main/Server/Unix/p4/common/bin/p4_vars.template | |||||
#1 | 10148 | C. Thomas Tyler | Promoted the Perforce Server Deployment Package to The Workshop. |