- #==============================================================================
- # Copyright and license info is available in the LICENSE file included with
- # the Server Deployment Package (SDP), and also available online:
- # https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE
- #------------------------------------------------------------------------------
- # Save SHELLOPTS
- _shellopts=$SHELLOPTS
- # Trap unbound (undefined) varialbes, treating them as an error.
- set -u
- export OSUSER=REPL_OSUSER
- export SDP_VERSION="REPL_SDPVERSION"
- export AWK=awk
- export CUT=cut
- export DF="df -h"
- export GREP=grep
- export ID=id
- export SDPMAIL=mail
- export PS=ps
- OS=`uname`
- if [ "${OS}" = "SunOS" ] ; then
- export AWK=/usr/xpg4/bin/awk
- export ID=/usr/xpg4/bin/id
- export SDPMAIL=mailx
- elif [ "${OS}" = "AIX" ] ; then
- export DF="df -m"
- fi
- # Which perforce instance are we configuring? Defaults to 1.
- export SDP_INSTANCE=${1:-1}
- # The P4INSTANCE variable is deprecated, and is maintained here for backward
- # compatibility. The SDP_INSTANCE variable should be referenced instead, as
- # P4INSTANCE may go away in a future release.
- export P4INSTANCE=$SDP_INSTANCE
- export P4SERVER="p4_${SDP_INSTANCE}"
- export P4SSLDIR=/p4/ssl
- export P4HOME="/p4/${SDP_INSTANCE}"
- export TMP=${P4HOME}/tmp
- export P4TMP=${P4HOME}/tmp
- # Explicitly unset environment variables that affect p4d server if they
- # are defined at startup, excluding those that are always defined in this
- # file, like P4ROOT, P4PORT, P4lOG, and P4JOURNAL. This prevents cross-
- # instance shell environment contamination if p4_vars is sourced multiple
- # times for different instances.
- unset P4AUTH P4CHANGE P4DEBUG P4AUDIT P4TARGET
- export P4ROOT=${P4HOME}/root
- export P4DTG_ROOT=/p4/common/dtg
- export P4JOURNAL=${P4HOME}/logs/journal
- export P4CONFIG=${P4HOME}/.p4config
- export P4TICKETS=${P4HOME}/.p4tickets
- export P4TRUST=${P4HOME}/.p4trust
- export P4ENVIRO=/dev/null/.p4enviro
- 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 P4CCFG=/p4/common/config
- export P4CLIB=/p4/common/lib
- export PERLHOME=/p4/common/perl
- export PERL5LIB=$PERLHOME/lib:$P4CLIB:${PERL5LIB:-}
- export PYHOME=/p4/common/python
- export HMS_HOME=/p4/common/hms
- export PATH=$P4HOME/bin:$P4CBIN:$PYHOME/bin:$PERLHOME/site/bin:$PERLHOME/bin:$PATH:.
- export MANPATH=$PERLHOME/site/man:$PERLHOME/man:${MANPATH:-}
- if [[ -r ${P4ROOT}/server.id ]]; then
- export SERVERID=$(cat ${P4ROOT}/server.id)
- else
- # If a real ServerID is not set via a server.id file, use the short
- # hostname as a default. This is not appropriate for a real p4d,
- # but is fine for SDP-managed machines that use just a proxy or broker.
- # In those cases, SERVERID is used to define the service user, prefixed
- # with 'svc_'. This works well if reasonable host names are assigned.
- export SERVERID=${HOSTNAME%%.*}
- fi
- # P4Proxy Settings
- export P4PCACHE=$P4HOME/cache
- # Set Proxy monitoring level to 3 in order to monitor all traffic for all operations
- export PROXY_MON_LEVEL=3
- # 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_checkpoint.sh, live_checkpoint.sh,
- # or recreate_db_checkpoint.sh are run.
- # Set KEEPCKPS=0 to avoid automated cleanup of checkpoints and logs.
- export KEEPCKPS=7
- # KEEPJNLS allows you to keep a different number of journals than checkpoints
- # in case you rotate the journal more frequently than you run checkpoints.
- export KEEPJNLS=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=7
- # Don't change this; change or comment the above as needed
- export P4BIN=${P4HOME}/bin/p4_${SDP_INSTANCE}
- export P4DBIN=${P4HOME}/bin/p4d_${SDP_INSTANCE}
- export P4PBIN=${P4HOME}/bin/p4p_${SDP_INSTANCE}
- export P4BROKERBIN=${P4HOME}/bin/p4broker_${SDP_INSTANCE}
- export P4WEBBIN=${P4HOME}/bin/p4web_${SDP_INSTANCE}
- export P4DTGBIN=${P4HOME}/bin/p4dtg_${SDP_INSTANCE}
- # 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)
- # Sets instance specific vars. Last so that the caller sees the error.
- if [ -f "/p4/common/config/${P4SERVER}.vars" ] ; then
- . /p4/common/config/${P4SERVER}.vars
- fi
- # if 'nounset' was not in SHELLOPTS when we started, call set +u
- if [[ $_shellopts != *nounset* ]]; then
- set +u
- fi
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 23314 | matt_peterson | integrate sdp version 23041 | 7 years ago | |
//guest/perforce_software/sdp/main/Server/Unix/p4/common/config/p4_vars.template | |||||
#26 | 22685 | Russell C. Jackson (Rusty) | Update main with current changes from dev. | 8 years ago | |
#25 | 21774 | akwan | update p4p_base to incorporate proxy monitoring and set default value in p4_vars | 8 years ago | |
#24 | 21483 | C. Thomas Tyler | Released SDP 2016.2.21480 (2017/01/11). Copy Up using 'p4 copy -r -b perforce_software-sd...p-dev'. « |
8 years ago | |
#23 | 20767 | C. Thomas Tyler | Released SDP 2016.2.20755 (2016/09/29). Copy Up using 'p4 copy -r -b perforce_software-sd...p-dev'. « |
9 years ago | |
#22 | 20390 | C. Thomas Tyler | Released SDP 2016.1.20387. Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with... selective removal of changes related to work-in-progress files. « |
9 years ago | |
#21 | 20353 | C. Thomas Tyler | Released SDP 2016.1.20348. Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with... selective removal of changes related to work-in-progress changes. « |
9 years ago | |
#20 | 20050 | C. Thomas Tyler | Released: 2016.1.20028 (2016/08/03). Copy Up using 'p4 copy -r -b perforce_software-sdp-d...ev'. « |
9 years ago | |
#19 | 19898 | C. Thomas Tyler | Released SDP/MultiArch/2016.1/19888 (2016/07/07). Copy Up using 'p4 copy -r -b perforce_s...oftware-sdp-dev'. « |
9 years ago | |
#18 | 19694 | C. Thomas Tyler | Released SDP/MultiArch/2016.1/19661 (2016/06/08). Copy Up using 'p4 copy -r -b perforce_s...oftware-sdp-dev'. « |
9 years ago | |
#17 | 18961 | C. Thomas Tyler | Released: SDP/MultiArch/2016.1/18958 (2016/04/08). | 9 years ago | |
#16 | 18619 | Russell C. Jackson (Rusty) | Updating main with current changes. | 9 years ago | |
#15 | 15856 | C. Thomas Tyler | Replaced the big license comment block with a shortened form referencing the LICENSE file... included with the SDP package, and also by the URL for the license file in The Workshop. « |
10 years ago | |
#14 | 15691 | Russell C. Jackson (Rusty) | Changed to always create a checkpoints.rep directory on the logs volume so that moving th...e pre-rotated journal back to be the live journal will be a move operation when doing a failover. Added a SHAREDDATA setting to p4_vars so that I could check for that in sync_replica and weekly_sync replica. That allowed me to delete weekly_sync_shared_replica and sync_shared_replica. Added cleanup of checkpoints.rep to sync_replica and weekly_sync_replica since that is where the replica journals should always be located now. Removed cleanup of checkpoints.rep from daily and weekly backup scripts since those should not be handling replica file clean up. The SDP is now designed to be used with the journalcopy and p4 pull -L commands rather than the old style replication using just pull. Failover requires that you move the pre-rotated journal that is in the checkpoints.rep directory back to /p4/${SDP_INSTANCE}/logs/journal now along with updating the server.id file. « |
10 years ago | |
#13 | 15370 | C. Thomas Tyler | Minor tweaks to p4_vars.template: * Added comments for MAILTO and MAILFROM, clarifying th...at MAILTO can have a comma-delimited list (no spaces) and MAILFROM must be a single address. Cleanup: Added 'export' declarations so a few extra lines containing only export declarations could be deleted. Collateral benefit is that CUT, GREP, and PS are now exported consistently along with their friends AWK, SED, MAIL, DF, ID, etc. « |
10 years ago | |
#12 | 14073 | Russell C. Jackson (Rusty) | Backed out changes that moved variables to p4_vars. The variables are intended to be in i...nstance vars to keep everything about a particular instance in one location. It was confusing for people to see a setting in p4_vars and not understand that setting was being overridden in the instance vars. There shouldn't be any overlap between p4_vars and instance vars anymore. Also, server.id is not optional. It must exist. It is how you control whether the instance is a master or a replica. It is not set by the scripts anymore because that was also confusing people. They would try to change the role of a server by changing server.id and we previously would just overwrite their changes. Now, the SDP just reads the server.id so that the user has control over it. That doesn't confuse them since that is how our docs tells them to change a server's role. « |
10 years ago | |
#11 | 14045 | Robert Cowham | Move some stuff from instance_vars to p4_vars (or at least for defaults). Clarify user me...ssages. « |
10 years ago | |
#10 | 13937 | C. Thomas Tyler | Pushing SDP 2015.1.13934. | 10 years ago | |
#9 | 13908 | C. Thomas Tyler | Pushing SDP 2015.1.13906. | 10 years ago | |
#8 | 12463 | Russell C. Jackson (Rusty) | Changed keeplogs to 7 to match checkpoints. | 10 years ago | |
#7 | 12113 | Russell C. Jackson (Rusty) | Moved ssl dir to /p4. There is no need for an ssl directory under each instance. ...;There are also some signs of possible issues with the certificates residing on an NFS mounted volume in one environment so far. « |
10 years ago | |
#6 | 11919 | Russell C. Jackson (Rusty) | Added a SERVERID variable to p4_vars and updated backup_functions to use it. Cha...nged the location and the names of the config files so that they could live in /p4/common/config (You're welcome Tom). The files names are: p4_$INSTANCE.vars p4_$INSTANCE.p4review.cfg p4_$INSTANCE.vars will now set P4REPLICA to FALSE if SERVERID matches MASTERNAME, otherwise it is TRUE. This change means that a user must change server.id now in order to change the role of the server rather than changing the instance vars file. This makes more sense to a user that is reading the admin guide about server.id rather than overwriting the file based on a setting that isn't in the admin guide. Change mkdirs to reflect all of the above changes. « |
10 years ago | |
#5 | 11908 | adrian_waters | Use set -u to trap unbounded variables | 10 years ago | |
#4 | 11758 | Russell C. Jackson (Rusty) | Change MAIL variable to SDPMAIL to avoid conflicts with customer variables. Chan...ged sdp_sync.sh to use get_mail_opts from backup_functions to avoid duplicate functions. « |
10 years ago | |
#3 | 11730 | Russell C. Jackson (Rusty) | Moved P4SERVER variable to p4_vars so that all scripts can use it properly. replic...a_status.sh referenced it, but it wasn't working since it was only in backup_functions.sh « |
10 years ago | |
#2 | 11570 | Russell C. Jackson (Rusty) | Brought in changes from Mark Foundry to add -S $MAILFROM to mail commands. Chang...ed sync_replica.sh and weekly_sync_replica.sh to use $LOGFILE for consistency. Added mail command to both files as well. « |
10 years ago | |
#1 | 11524 | Russell C. Jackson (Rusty) | Released updated version of the SDP from Dev. | 10 years ago | |
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/config/p4_vars.template | |||||
#1 | 11477 | Russell C. Jackson (Rusty) | Updated to use /usr/bin/env python Added workshop header. Changed cfg to conf...ig. « |
10 years ago | |
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/cfg/p4_vars.template | |||||
#1 | 11474 | Russell C. Jackson (Rusty) | Had to move the cfg directory to the metadata volume and link it under the instance direc...tory 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. « |
10 years ago | |
//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 inst...ances 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. « |
10 years ago | |
#3 | 10994 | Robert Cowham | Catchup from Main | 10 years ago | |
#2 | 10867 | C. Thomas Tyler | Merge Down: Rereshed 'dev' from 'main'. | 10 years ago | |
#1 | 10638 | C. Thomas Tyler | Populate perforce_software-sdp-dev. | 10 years ago | |
//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. | 11 years ago |