#------------------------------------------------------------------------------ # Instance specific variables set/calculated in this file. This is not # intended to be sourced directly. It is sourced when /p4/common/bin/p4_vars # is sourced. # Disable shellcheck requirement for shebang line, as this file is sourced # in (from p4_vars) rather than executed as a script. # shellcheck disable=SC2148 # This file is processed by mkdirs.sh to update REPL_* values as appropriate. # It can subsequently be edited if required. # Various scripts send email to $MAILTO. This can contain comma-delimited list # of email addresses (no spaces). export MAILTO=REPL_MAILTO # Specify the email adddress from which emails are sent in $MAILFROM. # This must be exactly one email address. export MAILFROM=REPL_MAILFROM export P4USER=REPL_ADMINUSER export P4SERVICEUSER=svc_${SERVERID} # P4MASTER_ID is server.id of Master for this instance export P4MASTER_ID=REPL_MASTER_ID # The setting below should be ssl: if this instance uses ssl. export SSL_PREFIX=REPL_SSLPREFIX export P4PORTNUM=REPL_P4PORT export P4PORT=${SSL_PREFIX}${P4PORTNUM} # Set the value for P4BROKERPORT to Unset if the broker is not # used. export P4BROKERPORTNUM=REPL_P4BROKERPORT export P4BROKERPORT=${SSL_PREFIX}${P4BROKERPORTNUM} # These $P4D_FLAGS show when using 'ps' to scan the process table. # Other settings affect p4d. export P4D_FLAGS="-p $P4PORT -r $P4ROOT -J $P4JOURNAL -L $P4LOG -q -d --pid-file" # Default values of the following - may be overwritten below # This is the DNS name of the master server export P4MASTERHOST=REPL_P4MASTERHOST export P4MASTERPORT=${SSL_PREFIX}${P4MASTERHOST}:${P4PORTNUM} export P4REPLICA=FALSE # SHAREDDATA defaults FALSE, but is set to TRUE on replica servers that share their /hxdepots # volume with their P4TARGET server - as per lbr.replication configurable export SHAREDDATA=FALSE # SERVERID is defined in /p4/n/root/server.id. if [[ -n "$SERVERID" && "$SERVERID" != "$P4MASTER_ID" ]]; then export P4REPLICA=TRUE if [[ -f "$P4ROOT/db.domain" ]]; then # Use egrep becuase it works where we need it to. Shellcheck suggests # using 'grep -E' instead. # shellcheck disable=SC2196 targetServerPort=$("$P4DBIN" -r "$P4ROOT" -cshow | egrep "^$SERVERID: P4TARGET = ") targetServerPort=${targetServerPort##* = } # Use 'echo' w/o quotes to remove leading/trailing whitepsace. # shellcheck disable=SC2116 disable=SC2086 targetServerPort=$(echo $targetServerPort) else targetServerPort=$P4PORTNUM fi if [[ -n "$targetServerPort" ]]; then export P4MASTERPORT="$targetServerPort" if [[ "$targetServerPort" == *":"* ]]; then # strip off any trailing ':.....' element (e.g., ':1666') export P4MASTERHOST="${targetServerPort%:*}" # if P4TARGET includes ssl, also need to strip off ssl: from front export P4MASTERHOST="${P4MASTERHOST#*:}" fi fi repStyle="readonly" if [[ -f "$P4ROOT/db.domain" ]]; then repStyle=$("$P4DBIN" -r "$P4ROOT" -cshow|"$GREP" "^$SERVERID: lbr.replication = ") repStyle=${repStyle##* = } # Use 'echo' w/o quotes to remove leading/trailing whitepsace. # shellcheck disable=SC2116 disable=SC2086 repStyle=$(echo $repStyle) fi if [[ $repStyle == "shared" ]]; then # Used by p4verify.sh among others export SHAREDDATA=TRUE fi fi # Proxy settings export PROXY_TARGET=${SSL_PREFIX}${P4MASTERHOST}:${REPL_P4P_TARGET_PORT:-$P4PORTNUM} export PROXY_PORT=$P4PORT # P4DTG Settings: export P4DTG_CFG=$P4SERVER # If SNAPSHOT_SCRIPT is defined and set to the path of an executable # script, daily_checkpoint.sh will call the referenced script to # perform a snapshot. The following sample enable snapshots on the # AWS master server only if [[ -n "$SERVERID" && "$SERVERID" == "$P4MASTER_ID" ]]; then export SNAPSHOT_SCRIPT= #export SNAPSHOT_SCRIPT=/p4/common/cloud/aws/bin/snapshot.sh else export SNAPSHOT_SCRIPT= fi export SDP_ALWAYS_LOGIN=0 umask 0026