ps_functions.sh #3

  • //
  • p4-sdp/
  • dev_rebrand/
  • Server/
  • Unix/
  • p4/
  • common/
  • bin/
  • ps_functions.sh
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/bin/bash
#==============================================================================
# Copyright and license info is available in the LICENSE file included with
# the Server Deployment Package (SDP), and also available online:
# https://workshop.perforce.com/view/p4-sdp/main/LICENSE
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Version ID Block. Relies on +k filetype modifier.
# VersionID='$Id: //p4-sdp/dev_rebrand/Server/Unix/p4/common/bin/ps_functions.sh#3 $ $Change: 31617 $'

# Common functions for using 'ps' to check on process ids.

# get_pids ($exe)
# Usage: Call with an exe name, e.g. /p4/1/bin/p4web_1
#
# Example:
# p4web_pids=$(get_pids $P4WEBBIN)
# p4broker_pids=$(get_pids $P4BROKERBIN)

# This implementation works on Mac OSX and a variety of Unix/Linux systems.
get_pids () {
   exe=$1
   pids=$($PS -ef|$GREP "${exe}"| $GREP -v " $GREP " | $GREP -v "${exe}_init " | $AWK '{print $2}')
   echo $pids
}
# Change User Description Committed
#3 31617 C. Thomas Tyler Merged work from dev_c2s (development) stream to sibling dev_rebrand (sparsedev) stream.
#2 31615 C. Thomas Tyler First pass at rebranding changes, including:
* Changes to remove 'swarm.' from Workshop URLS, so swarm.workshop -> workshop.
* Changed URL for Copyright.
* Renamed get_helix_binaries.sh -> get_p4_binaries.sh, with associated directory and doc changes.
* Accounted for rename of HAS -> P4AS.
* Changed HMS references to P4MS.
* Replaced "Helix" and "Helix Core" references.
* Renamed variables to reduce tech debt buildup induced by rebranding.
* Changed default mount points:
/hxdepots[-1,N] -> /p4depots[-1,N]
/hxmetadata[1,2] -> /p4db[-1,2]
/hxlogs -> /p4logs

Also made some changes related to rebranding going out with r25.1.
#1 31591 C. Thomas Tyler Populate stream //p4-sdp/dev_rebrand from //p4-sdp/dev.
//p4-sdp/dev/Server/Unix/p4/common/bin/ps_functions.sh
#1 31397 C. Thomas Tyler Populate -b SDP_Classic_to_Streams -s //guest/perforce_software/sdp/...@31368.
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/ps_functions.sh
#5 18767 C. Thomas Tyler Fixed bug with proxy init script wrongly indicating proxy
is up when it's not.
#4 16029 C. Thomas Tyler Routine merge to dev from main using:
p4 merge -b perforce_software-sdp-dev
#3 12169 Russell C. Jackson (Rusty) Updated copyright date to 2015

 Updated shell scripts to require an instance parameter to eliminate the need
 for calling p4master_run.    Python and Perl still need it since you have to set the
environment for them to run in.

 Incorporated comments from reviewers. Left the . instead of source as that seems
more common in the field and has the same functionality.
#2 12028 C. Thomas Tyler Refreshed SDP dev branch, merging down from main.
#1 10638 C. Thomas Tyler Populate perforce_software-sdp-dev.
//guest/perforce_software/sdp/main/Server/Unix/p4/common/bin/ps_functions.sh
#1 10148 C. Thomas Tyler Promoted the Perforce Server Deployment Package to The Workshop.