#!/bin/bash #============================================================================== # 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 #------------------------------------------------------------------------------ # # Use "chkconfig --add p4broker_REPL_SDP_INSTANCE_init" to set up the script # to start and stop automatically. # # Perforce Init Script. # chkconfig: - 90 30 # description: Start Perforce broker instance REPL_SDP_INSTANCE # Usage: p4broker_REPL_SDP_INSTANCE_init start|stop|status|restart [<ConfigTag>|all] # The ConfigTag can use the special values 'all'. For example, # 'p4d_REPL_SDP_INSTANCE_init status all' can be used to determine # which broker configuration(s) are running. When starting mulitple # broker configurations, be sure they are not configured to listen on # the same port. If ConfigTag is omitted, it is the equivalent of # specifying 'default'. # # The default broker config is /p4/common/config/p4_N.broker.cfg, (where # N is the instance name), which can be overridden on specifc machines if # there exists a file named /p4/common/config/p4_N.broker.<short-hostname>.cfg. # # Additional broker config files can be defined by creating broker config # files named /p4/common/config/p4_N.broker.YourTagName.cfg, e.g. # /p4/common/config/p4_N.broker.dfm.cfg (the "Down For Maintenance" config # file.). declare OpMode=${1:-status} declare ConfigTag=${2:-default} declare ConfigTagList= declare -i ExitStatus=0 # Load SDP shell environment for Instance REPL_SDP_INSTANCE. source /p4/common/bin/p4_vars REPL_SDP_INSTANCE || exit 1 if [[ "$ConfigTag" == "all" ]]; then ConfigTagList="default $(cd ${P4CCFG}; ls ${P4SERVER}.broker.*.cfg | cut -d '.' -f 3)" ConfigTagList=$(echo $ConfigTagList) else ConfigTagList=$ConfigTag fi for tag in $ConfigTagList; do if [[ $tag == default ]]; then if [[ -r /p4/common/config/${P4SERVER}.broker.${HOSTNAME%%.*}.cfg ]]; then export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.${HOSTNAME%%.*}.cfg else export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.cfg fi else export P4BROKERCFG=${P4CCFG}/${P4SERVER}.broker.${tag}.cfg fi if [[ ! -r "$P4BROKERCFG" ]]; then echo -e "\nError: Missing broker config file $P4BROKERCFG.\n" ExitStatus=1 continue fi $P4CBIN/p4broker_base "$OpMode" "$tag" || ExitStatus=1 done exit $ExitStatus
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#11 | 20519 | C. Thomas Tyler |
Released SDP 2016.1.20491 (2016/09/09). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with selective removal of work-in-progress files. |
||
#10 | 20481 | C. Thomas Tyler |
Released SDP 2016.1.20460. Copy Up using 'p4 copy -r -b perforce_software-sdp-dev', with selective removal of changes related to work-in-progress files. |
||
#9 | 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. |
||
#8 | 18961 | C. Thomas Tyler | Released: SDP/MultiArch/2016.1/18958 (2016/04/08). | ||
#7 | 18619 | Russell C. Jackson (Rusty) | Updating main with current changes. | ||
#6 | 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. |
||
#5 | 13917 | C. Thomas Tyler | Pushing SDP 2015.1.13915. | ||
#4 | 12873 | Russell C. Jackson (Rusty) | Dropped server.id from the filename. | ||
#3 | 11924 | Russell C. Jackson (Rusty) |
Change the location and name of the broker config file. It now lives here: /p4/common/config/${P4SERVER}.${SERVERID}.broker.cfg I made it both instance and server unique because you may want different settings depending on if you are running a master or a replica. |
||
#2 | 11524 | Russell C. Jackson (Rusty) | Released updated version of the SDP from Dev. | ||
#1 | 10148 | C. Thomas Tyler | Promoted the Perforce Server Deployment Package to The Workshop. |