#------------------------------------------------------------------------------ # 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. # # This defines the version of the format of this file, used when the SDP is # upgraded. SDP_INSTANCE_VARS_FORMAT=1.2 # 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 address 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 # P4MASTERHOST=DNS Name (or IP address) of master FOR THIS INSTANCE. # A DNS Name is much easier to manage for failover purposes. # Examples: # - edge server: set this to DNS for commit-server # - replica: set this to DNS for parent server # - HA replica for commit: set this to DNS for commit-server # - HA replica for edge: set this to DNS for edge-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" && ! -f "$P4ROOT/P4ROOT_not_usable.txt" ]]; then # Use egrep because 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 whitespace. # 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" && ! -f "$P4ROOT/P4ROOT_not_usable.txt" ]]; then repStyle=$("$P4DBIN" -r "$P4ROOT" -cshow|"$GREP" "^$SERVERID: lbr.replication = ") repStyle=${repStyle##* = } # Use 'echo' w/o quotes to remove leading/trailing whitespace. # 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}:${P4BROKERPORTNUM} export PROXY_PORT=${SSL_PREFIX}$((P4BROKERPORTNUM+1)) export PROXY_V_FLAGS="-v net.autotune=1" # 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 scrip after # checkpoints are created. It is expected that the called custom script # will create a snapshot or perform some other backup activity. # The logic below allows for the called SNAPSHOT_SCRIPT to run only # on the master server. # # A sample script to enable snapshots on an AWS master # server is provided as: /p4/common/cloud/aws/bin/snapshot.sh # if [[ -n "$SERVERID" && "$SERVERID" == "$P4MASTER_ID" ]]; then # This snapshot script is exectued only on the master server. export SNAPSHOT_SCRIPT= else # Leave this value empty. export SNAPSHOT_SCRIPT= fi # Set VERIFY_SDP_SKIP_TEST_LIST as an alternative to passing in a lists of tests # using the '-skip' flag to the verify_sdp.sh script. The command line flag to # the script is more appropriate if a test is to be skipped temporarily, while # setting the VERIFY_SDP_SKIP_TEST_LIST variable is better for making a permanent # exception (e.g. skipping crontab checks if some other scheduler is used). # # The value is a comma-delimited list of tests to skip, as defined in the # documentation for verify_sdp.sh. For more info, run: verify_sdp.sh -man export VERIFY_SDP_SKIP_TEST_LIST= export SDP_ALWAYS_LOGIN=0 # The SDP_MAX_START_DELAY_* settings are numeric values that define the maximum # number of second to wait for services to start before considering the startup # a failure in various SDP scripts. Successful start is indicated by being # responsive to a 'p4 info' command and the appropriate port for each service. export SDP_MAX_START_DELAY_P4D=120 export SDP_MAX_START_DELAY_P4BROKER=60 export SDP_MAX_START_DELAY_P4P=60 # The SDP_MAX_STOP_DELAY_* settings are numeric values that define the maximum # number of second to wait for services to stop before considering the shutdown # a failure in various SDP scripts. Successful stop is indicated by removal of # the server.pid file for p4d, and lack of active pids for p4broker/p4p. These # values are typically never used. Note that 'p4d' does not have a max delay. export SDP_MAX_STOP_DELAY_P4BROKER=600 export SDP_MAX_STOP_DELAY_P4P=600 # Set SDP_AUTOMATION_USERS to a comma-delimited list of Perforce user accounts # to login when the 'p4login' script is used with the '-automation' flag. This # will normally be a list of users that operate trigger scripts, such as the # 'swarm' user if Helix Swarm is used. Typically such users will have long-term # tickets. For more info, run: p4login -man export SDP_AUTOMATION_USERS="swarm" umask 0026 #------------------------------------------------------------------------------ # Custom Local Changes #------------------------------------------------------------------------------ # Any instance-specific local customizations should appear in the file sourced # below in the /p4/common/site structure, which contains site-specific that # are not part of the SDP package. if [[ -r "/p4/common/site/config/$P4SERVER.vars.local" ]]; then source "/p4/common/site/config/$P4SERVER.vars.local" fi