### Install P4 Broker as a Windows Service Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker.running.html These commands demonstrate the process of installing and starting the P4 Broker as a Windows service, including copying executables, creating the service, setting its options, and starting it. ```batch C:\> cd C:\p4broker\ C:\p4broker\> copy p4broker.exe p4brokers.exe C:\p4broker\> copy "C:\Program Files\Perforce\Server\svcinst.exe" svcinst.exe C:\p4broker\> svcinst create -n _P4Broker_ -e "C:\p4broker\p4brokers.exe" -a C:\p4broker\> p4 set -S _P4Broker_ P4BROKEROPTIONS="-c C:\p4broker\p4broker.conf" C:\p4broker\> svcinst start -n _P4Broker_ ``` -------------------------------- ### Install P4 MCP Server via Command Line Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4-mcp.html Installs and starts the P4 MCP Server using the uvx command-line tool. Ensure uvx is installed and configured. ```bash uvx p4mcp-server ``` -------------------------------- ### Troubleshooting Service Start Failure Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.commands.html Example of a p4dctl command used to execute a server upgrade command when services fail to start. ```bash sudo -u "perforce" p4dctl exec -t p4d commit-US -- -xu # server commit-US ``` -------------------------------- ### Start New Server Privately Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/moving.same_byte_order.html Start the new server using `localhost` for P4PORT to deny remote connections during setup. This allows access only from the server host itself. ```bash p4d -r _new-server-P4ROOT_ -p localhost:1234 ``` ```bash p4d -r _new-server-P4ROOT_ -p 1234 ``` -------------------------------- ### Example Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.advanced.list_processes.html An example of the default output from the 'p4 monitor show' command. ```bash $ **p4 monitor show** 74612 R qatool 00:00:47 job 78143 R edk 00:00:01 filelog 78207 R p4admin 00:00:00 monitor ``` -------------------------------- ### Start p4d with IPv6 and plaintext support Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/installing-linux-non-package-port.html Enable IPv6 support by specifying the wildcard address with two colons when starting p4d. This example listens for plaintext connections on both IPv6 and IPv4 transports. ```bash p4d -p tcp64:[::]:1818 ``` -------------------------------- ### Example of multiple file configuration Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.config.multiple.html This example demonstrates how to set environment variables and include additional configuration files from a directory. ```shell Environment { PATH = /bin:/usr/bin:/usr/local/bin:/opt/perforce/sbin } include /etc/perforce/p4dctl.conf.d ``` -------------------------------- ### Start P4 Broker with Configuration File Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker.running.html Use this command to start the P4 Broker, specifying the configuration file directly. ```bash p4broker -c config_file ``` -------------------------------- ### Example P4 Server Startup Commands Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-startup-commands.html This example configures pull threads for metadata and file ranges with specific intervals, and sets up LDAP group synchronization. ```bash startup.1=pull -i 1 ``` ```bash startup.2=pull -u -i 1 --batch=1000 --min-size=1 --max-size=2047 ``` ```bash startup.3=pull -u -i 2 --batch=10 --min-size=2048 --max-size=4096 ``` ```bash startup.4=pull -u -i 3 --batch=5 --min-size=4097 ``` ```bash startup.5=ldapsync -g -i 1800 ``` -------------------------------- ### Install p4-server on Ubuntu Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install-linux-packages-install.html Use this command to install the p4-server package on Ubuntu systems using APT. ```bash sudo apt-get install p4-server ``` -------------------------------- ### Example Output with Arguments Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.advanced.list_processes.html Example output when using the '-a' flag to display command arguments. ```bash $ **p4 monitor show -a** 74612 R qatool 00:00:48 job job004836 78143 R edk 00:00:02 filelog //depot/main/src/proj/file1.c //dep 78208 R p4admin 00:00:00 monitor show -a ``` -------------------------------- ### Install P4Broker on Ubuntu Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker.installation.html Use apt-get to install the p4-broker package on Ubuntu systems. ```bash sudo apt-get install p4-broker ``` -------------------------------- ### Start P4 Server (Basic) Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.unix.start.html Starts the P4 server in the background. Ensure P4PORT and P4ROOT environment variables are set beforehand. ```bash p4d & ``` -------------------------------- ### Example Server Configuration Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/commit-edge-shortcuts.html This is an example of the output from `p4 server -o mynewedge`, showing the configured `DistributedConfig` settings. ```text DistributedConfig: db.replication=readonly lbr.replication=readonly startup.1=pull -i 1 startup.2=pull -u -i 1 startup.3=pull -u -i 1 P4TARGET=localhost:20161 serviceUser=service ``` -------------------------------- ### Example Output with Environment Details Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.advanced.list_processes.html Example output when using the '-e' flag to display user environment details. ```bash $ **p4 monitor show -e** 74612 p4/2011.1 192.168.10.2 R qatool buildenvir 00:00:47 job 78143 192.168.10.4 R edk eds_elm 00:00:01 filelog 78207 p4/2011.1 192.168.10.10 R p4admin p4server 00:00:00 monitor ``` -------------------------------- ### Example: Open Edge Server Spec Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/commit-edge-shortcuts.html An example of opening a server spec for an edge server named 'mynewedge'. ```bash p4 server -c edge-server mynewedge ``` -------------------------------- ### Start Replica Server (Initial) Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-creating-read-only-replica.html Starts the P4 server on the replica machine with specific options. The -n option is used initially to avoid license requirements. ```bash p4d -r /p4/root -p replica1667 -n -d ``` -------------------------------- ### Install Server Extension Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensiondevelopment.html Install a packaged server extension to the P4 Server. The --yes option is required to confirm the installation. ```bash p4 extension --install _extName_.p4-extension --yes ``` -------------------------------- ### Start New P4 Server Service Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install-windows-manage-multiple-services.html Starts the newly created P4 Server Windows service using the `svcinst start` command. ```bash svcinst start -n Perforce2 ``` -------------------------------- ### Install Git Connector on Ubuntu Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install-config.install.html Use this command to install the p4-git-connector package on Ubuntu systems using apt-get. ```bash $ sudo apt-get install p4-git-connector ``` -------------------------------- ### Start forwarding replica server Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-forwarding-configuring.html Starts the P4 server on the forwarding replica with specific P4PORT and options. The -n option is temporary. ```bash p4d -r /replica/root -p forward:1667 -n -d ``` -------------------------------- ### Example Output with Long Form Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.advanced.list_processes.html Example output when using the '-a' and '-l' flags to display non-truncated information. ```bash $ **p4 monitor show -a -l** 74612 R qatool 00:00:50 job job004836 78143 R edk 00:00:04 filelog //depot/main/src/proj/file1.c //dep ot/main/src/proj/file1.mpg 78209 R p4admin 00:00:00 monitor show -a -l ``` -------------------------------- ### Start P4 Server with Custom Options Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.unix.start.html Starts the P4 server with specified root directory, journal file, error log, and listening port. This overrides environment variables. ```bash p4d -r /usr/local/p4root -J /var/log/journal -L /var/log/p4err -p tcp64:[::]:1818 & ``` -------------------------------- ### Example p4d checkpoint command output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance-parallel-checkpoint.html This is an example of the output from the `p4d -jcmp` command when initiating a multi-file checkpoint. ```bash p4d -jcmp Checkpointing files to checkpoint.4... ``` -------------------------------- ### Simple Bind Method DN Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/auth.create.html An example of how the SimplePattern is expanded when a user logs in, showing the resulting Distinguished Name (DN). ```text uid=jsmith,ou=users,dc=example,dc=com ``` -------------------------------- ### Start P4 Server Service from Command Line Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install-windows-manage-start-stop.html Use this command in an administrator Command Prompt or PowerShell to start the P4 Server Windows service. ```bash net start perforce ``` -------------------------------- ### Example Depot Specification Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/depots.moving.prod.multiple-files.html This is an example output from the 'p4 depot -o depot' command, highlighting the 'Map' field which defines the depot's storage location. ```text ... Depot depot ... Date 2011/05/16 15:03:40 ... Description Default depot ... Type local ... Map depot/... ``` -------------------------------- ### Start P4D with Authorization Server Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/centralized-authorization-server.html Start a P4D server, specifying the authorization server host and port, and the P4D server's own port. ```bash p4d -a guardian:1666 -p 1999 ``` -------------------------------- ### Example .md5 file content Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance-parallel-checkpoint.html This is an example of the content found within a checkpoint's `.md5` file, detailing each checkpoint file, its MD5 digest, and a timestamp. ```text MD5 (checkpoint.3/db.config.ckp.gz) = 5A32E66EE638A52F480F476B0B78191E 1688033506  MD5 (checkpoint.3/db.configh.ckp.gz) = B26E2EBA2E35B5F138792549A585276D 1688033506  MD5 (checkpoint.3/db.counters.ckp.gz) = D9A5E3CE0728B6206E4A746CB6854994 1688033506  MD5 (checkpoint.3/db.nameval_00000001.ckp.gz) = 035080F2CDFDB5BE9FC5E9D640CF5ABA 1688033506  MD5 (checkpoint.3/db.nameval_00000004.ckp.gz) = 7D052BA5C906C7C3087FE49DB4FCD48D 1688033506 ``` -------------------------------- ### Install New License (P4 CLI) Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.tips.release.html Commands to install a new license file using the P4 CLI, either via standard input or redirection. ```bash cat license | p4 license -i ``` ```bash p4 license -i < license ``` -------------------------------- ### Example: Dump Specific Edge Server Tables Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/edge-server-metadata-recovery.html This example demonstrates dumping a specific list of tables from the edge server. The `-k` flag filters the tables to be dumped. ```bash p4d -r edgeroot -k "db.have,db.working,db.locks,db.resolve,db.revsh,db.workingx,db.resolvex,db.stash,db.haveg,db.workingg,db.locksg,db.resolveg,db.storagesh,db.storagesx,db.upgrades.rp,db.upgrades,db.scandir,db.scanctl,db.revstg,db.refcntadjust,db.have.pt,db.view,db.label,db.revsx,db.revux" -jd edgedump ``` -------------------------------- ### Example of initiating a checkpoint and listing files Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance-parallel-checkpoint.html This example shows how to initiate a checkpoint using `p4d -jcmp -z` and then lists the generated checkpoint files, including the `.md5` file. ```bash $ p4d -r . -jcmp -z Checkpointing files to checkpoint.3... Rotating journal to journal.2.gz... $ ls checkpoint.* checkpoint.3 -r--r--r-- 1 perforce perforce  9784 Jun 29 11:11 checkpoint.3.md5 ``` -------------------------------- ### Example Phrase for Secure Password Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.basic.password_strength.html Illustrates creating a secure password by starting with a memorable phrase. ```plaintext Perforce Enterprise-class Version Control. ``` -------------------------------- ### P4Broker Configuration File Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker-alternate-server-definitions.html A comprehensive P4Broker configuration file demonstrating how to set up a broker, define an alternate replica server, and configure command redirection and access control rules. ```ini target      = london:11111; listen      = 33333; directory   = /p4broker/root/; logfile     = broker.log; debug-level = server=1; admin-name  = "your name"; admin-phone = x1234; admin-email = your.name@yourcompany.dom redirection = selective; # # Add an "altserver" for the replica: # altserver: replica1 {     target    = replica:22222; } # # Add command handlers to redirect read-only metadata commands to the replica # command: ^(branches|changes|clients|counters|depots|dirs \     |filelog|files|fstat|groups|interchanges|jobs|labels|opened \     |sizes|fixes|where|workspaces|users)$ {     action  = redirect;     destination = replica1; } # # Prevent user joe from invoking p4 submit from the # buildonly client workspace. # command: submit {     user = joe;     workspace = buildonly;     action = reject;     message = "Submit failed: Please do not submit from this workspace."; } # # Allow user 'maria' to run 'p4 opened -a' but not without the '-a' option # command: opened {     flags = -a;     user = maria;     action = pass; } command: opened {     user = maria;     action = reject;     message = "Please use 'p4 opened -a'"; } ``` -------------------------------- ### Get Port Number on Linux Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/request-license.html On Linux, install 'net-tools' and run 'netstat -tulpn | grep p4'. Provide the line associated with the p4d process, which includes the port number. ```bash netstat -tulpn | grep p4 ``` ```text tcp 0 0 0.0.0.0:3614 0.0.0.0:* LISTEN 1842424/p4d.20201 ``` -------------------------------- ### Efficient label reference using egrep Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance.prevention.scripting.html This example shows a more efficient way to get labeled files by first retrieving all files under a path with the label and then filtering the output locally using egrep. ```bash $ **p4 files path/...@label | egrep "path/f1.h|path/f2.h|path/f3.h"** ``` -------------------------------- ### Example P4V Property Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.configure_p4v.precedence.html This is an example output from the 'p4 property -l -A -n' command, illustrating how a property can be set at system, user, and group levels. ```text P4V.Features.Integration = Off P4V.Features.Integration = On (user bill) P4V.Features.Integration = Off (group p4users) P4V.Features.Integration = On (group dev) ``` -------------------------------- ### Get IP Address on Linux Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/request-license.html Use 'ip -family inet6 -brief a' for IPv6 or 'ip -family inet -brief a' for IPv4 on Linux. Provide the line starting with 'en' that shows the IP address. ```bash ip -family inet6 -brief a ``` ```text lo UNKNOWN ::1/128 enp0s31f6 UP fe80::2a14:38ff:fe08:8150/64 ``` ```text enp0s31f6 UP fe80::2a14:38ff:fe08:8150/64 ``` ```bash ip -family inet -brief a ``` ```text lo UNKNOWN 127.0.0.1/8 enp0s3 UP 10.90.1.85/24 ``` ```text enp0s3 UP 10.90.1.85/24 ``` -------------------------------- ### P4DCTL Error Message Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.Installation.html This error message indicates a problem with the P4D server's startup or configuration, potentially due to incorrect privileges or file paths. It is logged by p4dctl when a managed P4D instance fails to start. ```text p4dctl error: 'master' p4d: '/opt/perforce/sbin/p4d -p 1666' exited with status 255. ``` -------------------------------- ### Example of Tight Client View Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance-tight-views.html This example demonstrates a 'tight' client view configuration, mapping specific depot paths to workspace paths. Use tight views to limit user access to only what is needed for their tasks. ```text //depot/main/srv/devA/... //workspace/main/srv/devA/... //depot/main/drv/lport/... //workspace/main/dvr/lport/... //depot/rel2.0/srv/devA/bin/... //workspace/rel2.0/srv/devA/bin/... //depot/qa/s6test/dvr/... //workspace/qa/s6test/dvr/... ``` -------------------------------- ### Example Server Extension Manifest Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensionjson.html Illustrates a complete server extension manifest file with various fields populated. ```json { "manifest_version":1, "api_version":1, "script_runtime":{ "language":"Lua", "version":"5.3" }, "key":"aaaaa-aaaa-aaaa-aaaa-aaaaa", "name":"ExtName", "namespace":"ExampleInc", "version":"1.0", "version_name":"1.0 beta", "limit_instance":"single", "description":"Example Extension to illustrate concepts.", "compatible_products":[ "p4d" ], "default_locale":"en", "supported_locales":[ "en", "jp" ], "developer":{ "name":"Example Extensions Inc.", "url":"https://p4-extensions.example.com/" }, "homepage_url":"https://p4-extensions.example.com/ExtName", "license":"BSD", "license_body":"Redistribution and use in source and binary forms..." } ``` -------------------------------- ### P4DCTL Args Setting Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.config.server.html Illustrates how to specify arguments for the server binary using the 'Args' setting. The argument string must be quoted. ```plaintext Args = "-C1" ``` ```plaintext Args = "-u us_proxy -v lbr.stat.interval=300 -v proxy.monitor.level=3 -v proxy.monitor.interval=300" ``` -------------------------------- ### Installing Specific Helix P4D Base Package Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/upgrade-overview.html Install a specific base package to allow the package manager to automatically install the latest patch. Use `update-alternatives` to manage different versions. ```bash apt-get install helix-p4d-base-r19.2 sudo update-alternatives --config helix-p4d ``` -------------------------------- ### P4 Info Command Output Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.unix.quick.html Example output from the './p4 info' command, showing client and server details. Note the 'Server address' line for connecting clients. ```text User name: perforce Client name: linux-bruno Client host: linux-bruno Client unknown. Current directory: /home/bruno/newinstall Peer address: 127.0.0.1:12345 Client address: 127.0.0.1 Server address: localhost:1666 Server root: /home/bruno/newinstall Server date: 2018/11/14 15:18:55 -0800 PST Server uptime: 00:00:09 Server version: P4D/LINUX26X86_64/2018.2/1234567 (2018/11/02) Server license: none Case Handling: sensitive ``` -------------------------------- ### IPv4 Address Format Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.tips.release.html Example of an IPv4 address format with a port number. ```text 10.90.1.85:1666 ``` -------------------------------- ### Get P4 Program Name Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensions.p4.html Get the name of the program as reported to the P4 Server. ```lua p4 = P4.P4:new() p4.prog = "sync-script" print( p4.prog ) ``` -------------------------------- ### Start P4D Service Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.commands.html Starts a specific P4D service by its name or all services of a given type. ```bash p4dctl [ _options_ ] start [ -t _type_ ] -a ``` ```bash p4dctl [ _options_ ] start [ -t _type_ ] _name_ ``` -------------------------------- ### Example Mirror List Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/mirror-hth-http.html Example output from the `gconn --mirrorhooks list` command, showing mirrored repositories and potential issues like a missing mirror configuration. ```text //hth/repoName <<< http://HelixTeamHub.com/hth/projects/projectName/repositories/git/repoName.git ... //hth/repoName2 <<< http://HelixTeamHub.com/hth/projects/projectName/repositories/git/repoName2.git ... Not mirrored by this Gconn instance ( no mirror config ) ``` -------------------------------- ### MAC Address Format Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.tips.release.html Example of a MAC address format using colon separators. ```text 98:43:fa:2c:23:bd ``` -------------------------------- ### Global Configuration Setting Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4dctl.config_file.html Demonstrates how to set a global configuration variable like PATH in the p4dctl configuration file. Settings outside a server block apply globally. ```config PATH = /bin:/user/bin ``` -------------------------------- ### Checkpoint Trailer Note Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/backup.concepts.journals.html An example of a checkpoint trailer note, indicating the completion of a checkpoint. ```text @nx@ 1 1296517767 @30@ 0 0 0 0 0 @@ @@ @@ @@ @@ ``` -------------------------------- ### Get P4 Server Port Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensions.p4.html Get the P4PORT value of the current P4 Server connection. ```lua p4 = P4.P4:new() print( p4.port ) ``` -------------------------------- ### Example of Loose Client View Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/performance-tight-views.html This example shows a 'loose' client view configuration, mapping the entire depot to the client workspace. Avoid loose views as they consume more server, client, and network resources. ```text //depot/... //workspace/... ``` -------------------------------- ### Get P4CONFIG File Path Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensions.p4.html Get the path to the current P4CONFIG file being used for the connection. ```lua p4 = P4.P4:new() print( p4.p4config_file ) ``` -------------------------------- ### Get P4 Server Hostname Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensions.p4.html Get the current hostname configured for the P4 Server connection. ```lua p4 = P4.P4:new() print( p4.host ) ``` -------------------------------- ### Example Changelist Files Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/DVCS/fetching.changelists.html This example lists files within a changelist, demonstrating which files would be included in a fetch or push operation based on a matching remote spec mapping. ```text //stream/main/p4/foo //stream/jam/bar ``` -------------------------------- ### Generate Sample Broker Configuration File Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/configuring-the-broker.html Use this command to generate a sample p4broker.conf file. You can then edit this file to specify your broker requirements. ```bash p4broker -C > p4broker.conf ``` -------------------------------- ### Install P4Broker on SUSE Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker.installation.html Use zypper to install the p4-broker package on SUSE Linux Enterprise Server. ```bash sudo zypper install p4-broker ``` -------------------------------- ### Start P4 Server Service Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.linux.packages.updating.html Restart your P4 Server service using the p4dctl start command. ```bash sudo -u perforce p4dctl start ``` -------------------------------- ### Create a Depot Client Specification Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install-config.setup-server.configure-client.html Use this command to create a new client specification for your depot. Replace '_clientName_' with your desired client name. ```bash $ p4 client _clientName_ ``` -------------------------------- ### Checkpoint Restore Error Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/backup.concepts.journals.html An example of an error message during checkpoint restoration, indicating a case-handling mismatch. ```text Perforce db files in '.' will be created if missing... Recovering from checkpoint.9... Perforce server error: Journal file 'checkpoint.9' replay failed at line 1! Bad transaction marker! Case-handling mismatch: server uses Windows-style (-C1) but journal flags are Unix-style (-C0)! ``` -------------------------------- ### Example: Git Connector Info Command Output Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/troubleshooting.special-commands.html This example demonstrates the execution of the `@info` special command and its typical output, including version and system details. Note that Git itself cannot parse these special commands, leading to a 'Fatal: Could not read from remote repository.' error after the P4 Info is displayed. ```bash $ **git clone git@_ConnectorHost_:@info** ``` ```text git clone git@connector.com:@info Cloning into '@info'... Perforce - The Fast Software Configuration Management System. Copyright 1995-2016 Perforce Software. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) See 'p4 help legal' for full OpenSSL license information Version of OpenSSL Libraries: OpenSSL 1.0.2j 26 Sep 2016 Rev. GCONN/LINUX26X86_64/2016.2.MAIN-TEST_ONLY/1460278 (2016/11/03). uname: Linux gconn-centos6 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 P4 Info: caseHandling: sensitive clientAddress: xx.x.xx.xxx clientCase: sensitive clientCwd: /home/git clientHost: gconn-centos6 clientName: **unknown** password: enabled peerAddress: xx.x.xx.xxx:47041 serverAddress: xx.x.xx.xxx:16200 serverDate: 2016/11/07 14:13:41 -0800 PST serverLicense: none serverRoot: /opt/perforce/servers/16200 serverServices: standard serverUptime: 76:01:42 serverVersion: P4D/LINUX26X86_64/2017.1.MAIN-TEST_ONLY/1460278 (2016/11/03) tzoffset: -28800 userName: gconn-user fatal: Could not read from remote repository. ``` -------------------------------- ### Install P4Broker on CentOS/RHEL Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/broker.installation.html Use yum to install the p4-broker package on CentOS or Red Hat Enterprise Linux. ```bash sudo yum install p4-broker ``` -------------------------------- ### Start P4 Server on Build Machine Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-build-server-configure.html Starts the P4 server on the build server machine with specified port and options. The -n option is required until the server ID is set for a license-exempt server type. ```bash p4d -p build:1667 -n -d ``` -------------------------------- ### Example Protections Table Configuration Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/protections.set.html Demonstrates how to configure exclusionary rights to protect specific depot areas. This example grants 'admin' access to user 'joe' for all depots but denies write and open permissions for the '//depot/build/...' area. ```text admin user joe * //... =write user joe * -//depot/build/... =open user joe * -//depot/build/... ``` -------------------------------- ### Configure p4 pull startup for Replica Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-filtering-replication-edge-to-edge.html Set the startup command for the replica's `p4 pull` metadata thread. ```bash p4 configure set "site1-1668#startup.1=pull -i 30" ``` -------------------------------- ### IPv6 Address Format Examples Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/install.tips.release.html Examples of IPv6 address formats for Windows and Linux/macOS, including the interface specifier. ```text ssl6:[2001:db8:a::21d:4fff:fe4a:8c60]:1666 ``` ```text ssl6:[2001:db8:a::21d:4fff:fe4a:8c60%2]:1666 ``` ```text IPv6 Address (Interface 2): 2001:db8:a::21d:4fff:fe4a:8c60 ``` ```text ssl6:2001:db8:a::21d:4fff:fe4a:8c60:1666 ``` -------------------------------- ### Example of Command Group Usage Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/structure-logging-using.html Demonstrates how to use command groups for organizing client operations and filtering logs based on command groups. ```bash p4 -zcommandGroup=myCmdGroup clients p4 logparse -F 'f_cmdgroup=myCmdGroup & f_eventtype=2' -T f_func,f_args all.csv ``` -------------------------------- ### Checkpoint Header Note Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/backup.concepts.journals.html An example of a checkpoint header note, which contains flags in effect during checkpoint creation. ```text @nx@ 0 1296517759 @30@ 2 0 0 0 0 @/p4root@ @journal@ @@ @@ @@ ``` -------------------------------- ### Start P4D Server in Unicode Mode Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/superuser.unicode.setup.html Use this command to initialize a new P4D server and enable Unicode mode. This verifies existing metadata and sets the server to run in Unicode. ```bash $ **p4d -xi -r _server_root_ [_other options_]** ``` -------------------------------- ### Start p4d with IPv6 and SSL support Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/installing-linux-non-package-port.html Start a Perforce service that requires SSL and listens on both IPv6 and IPv4 transports. ```bash p4d -p ssl64:[::]:1818 ``` -------------------------------- ### Example: Backup Specific Recovered Edge Server Tables Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/edge-server-metadata-recovery.html This example shows how to back up a specific list of tables from the recovered edge server data. The `-k` flag filters the tables. ```bash p4d -r edgeroot -k "db.have,db.working,db.locks,db.resolve,db.revsh,db.workingx,db.resolvex,db.stash,db.haveg,db.workingg,db.locksg,db.resolveg,db.storagesh,db.storagesx,db.upgrades.rp,db.upgrades,db.scandir,db.scanctl,db.revstg,db.refcntadjust,db.have.pt,db.view,db.label,db.revsx,db.revux" -jd recovered-edgedump ``` -------------------------------- ### Example Server Fingerprint Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/securing-server-key-generation.html This is an example of the output format for the server's public key fingerprint generated by `p4d -Gf`. ```text Fingerprint: CA:BE:5B:77:14:1B:2E:97:F0:5F:31:6E:33:6F:0E:1A:E9:DA:EF:E2 ``` -------------------------------- ### Create and Submit a New File Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-readonly-test.html Create a new file, mark it for add, and submit it to the depot. This tests the file replication process. ```bash echo "hello world" > myfile ``` ```bash p4 -u super -p london:1666 add myfile ``` ```bash p4 -u super -p london:1666 submit -d "testing replication" ``` -------------------------------- ### Create Server Extension Skeleton Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/Extensions/extensiondevelopment.html Use this command to generate a basic structure for a server extension on the client. This creates a directory with placeholder files. ```bash p4 extension --sample _extName_ ``` -------------------------------- ### P4Log Entry: Good Performance Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/p4log-using.html Example of a P4Log entry indicating no significant lock wait times for a table. ```text --- db.resolve --- total lock wait+held read/write 0ms+252ms/0ms+0ms ``` -------------------------------- ### View Graph Depots Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/depots-and-repos.create-depots.html Lists all graph depots configured on the server. Use this to verify existing graph depot setups. ```bash $ **p4 depots --depot-type=graph** ``` ```bash $ **p4 depots -t graph** ``` -------------------------------- ### Define Build Server Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/replication-build-configure-master.html Use the 'p4 server' command to initiate the configuration of a new build server. This command opens a default server specification for editing. ```bash p4 server build-1667 ``` -------------------------------- ### Checkpoint Duration Calculation Example Source: https://help.perforce.com/helix-core/server-apps/p4sag/current/Content/P4SAG/backup.concepts.journals.html Example showing checkpoint timestamps to calculate the duration. The endDate is 20 minutes after the startDate. ```text ... start 1713781651 ... startDate 2024/04/22 10:30:01 ... end 1713781651 ... endDate 2024/04/22 10:50:01 ... pid 1611629 ... type checkpoint ... flags (admin checkpoint) ... jnum 82 ... jfile /home/giles/depots/depot23200/Journals/commit.ckp.82 ... jdate 1713781651 ... jdateDate 2024/04/22 10:50:01 ... jdigest C89CC8CF4E185A8468AA2D63E851D41A ... jsize 1643548 ... jtype text ```