Server startup commands

You can configure P4 Server to automatically run commands at startup by using the p4 configure:

p4 configure set "servername#startup.n=command"

where n represents the order in which the commands are executed: the command specified for startup.1 runs first, then the command for startup.2, and so on. See startup.N in the P4 CLI Reference.

Key startup commands include p4 pull and p4 journalcopy.

The following example specifies:

  • one pull thread for metadata
  • three parallel pull threads, each for a different range of file sizes, where the pull interval is 1 second for small files and 3 seconds for large files
  • updating the LDAP groups every 30 minutes:
startup.1=pull -i 1
startup.2=pull -u -i 1  --batch=1000 --min-size=1 --max-size=2047
startup.3=pull -u -i 2  --batch=10 --min-size=2048 --max-size=4096
startup.4=pull -u -i 3  --batch=5 --min-size=4097
startup.5=ldapsync -g -i 1800

Additional commands you might consider are p4 cachepurge and p4 bgtask.

Server options to control metadata and depot access

To control metadata and depot access:

  1. Set the configurables db.replication (controls metadata replication) and lbr.replication (controls replication of versioned files) to define replication behavior.

  2. Start the replica that points to a master server with P4TARGET