p4 configure

Synopsis

Set and manage server configuration variables.

Syntax


p4 [g-opts] configure set [P4NAME#|server_id#]variable=value
p4 [g-opts] configure unset [P4NAME#|server_id#]variable
p4 [g-opts] configure show [allservers | P4NAME | variable]

Description

Configuration variables are used to control and customize the behavior of the Perforce service. The configuration variables are described in p4 help configurables, in p4 help environment, and in “Configurables”. Configurable settings might affect the client, the server, or a proxy.

The p4 configure command provides one way to change the configuration of an active server. For information on how you set configurables that affect the client or the proxy, see “Configurables”.

You can set configurables in the following ways for the server; methods are shown in order of precedence:

  • As command line options that are passed at server startup. For example:

    p4d -v net.keepalive.idle=2700
    
  • Persistently, using the p4 configure set command.

    This method allows you to set the specified configurable for a named server or for any server.

  • Using environment variables.

    When set using environment variables, certain server-related configurables are read-only; you cannot change P4ROOT or P4JOURNAL with p4 configure.

  • On Windows using the p4 set command.

  • On Unix, using the export command.

  • Using default values, by taking no action.

Use p4 configure show to display the configuration state of the current server, a named server, or any configurable. Each configurable is displayed along with its value and an indication of what method was used to set it. Use p4 configure unset to unset the value of a configurable.

After installing Perforce, it is good practice to enable process monitoring by setting monitor to 1 or 2, require ticket-based authentication by setting security to 3 or 4, and preventing the automatic creation of new users by setting dm.user.noautocreate to 1 or 2. Setting dm.user.resetpassword to 1 is also advisable; new users that you create (and to whom you assign an initial password) are forced to reset their passwords before they can issue commands.

Static, dynamic, and read-only configurables

Changes to dynamic configurables take effect the next time the server receives a new connection. Changes to static configurables, require a server restart. Values of read-only configurables may not be changed.

Changes to most configurables take effect immediately; for example, you do not have to restart the service in order for changes to configurables such as monitor (enable/disable the p4 monitor command) or security (set the security level) to take effect.

Changes to P4AUTH, P4PORT, the startup.n configurables used in replicated environments, net.tcpsize, and net.backlog require a restart.

To restart the server, use p4 admin restart.

Setting configurables in distributed environments

Servers can be identified by name. In replicated and distributed environments, a master can control the settings of multiple replicas by specifying the server name as part of the configurable. For example, the following command sets the value of the serviceUser configurable for an edge server (tokyo_edge). The command is executed on the commit server.

p4 set tokyo_edge#serviceUser=svc_tokyo_edge

See Perforce Server Administrator's Guide: Multi-site Deployment for details.

Accessing configurables when the server is down

If the Perforce server is not running or you cannot access the server, you can use the p4d command to list, set, and unset server configurables:

  • To list all server configuration variables, use the -cshow option. For example:

    p4d -r $P4ROOT -cshow
    
  • To set or unset values, use -cset or -cunset. For example:

    p4d -r $P4ROOT "-cset myServer#auth.ldap.timeout=30"
    p4d -r $P4ROOT "-cunset myServer#db.replication"
    

For more information, see Accessing Server Configuration Variables.

Options

set variable=value

Sets the named variable to the provided value.

In a p4 cluster environment, you can use the cluster name instead of P4NAME for cluster-scoped configurables.

unset variable

Unsets the named variable.

show

Shows the current configuration of the server currently specified by P4PORT.

show allservers

Shows the configuration variables for all servers known to the system.

show variable

Shows the setting of a specific configuration variable.

show P4NAME

If a Perforce server was invoked with -In P4NAME or with the P4NAME environment variable set to a server name, shows the settings of the named server.

g-opts

See “Global Options”.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required

N/A

N/A

super

Related Commands

To list all counters and their values

The p4 configure command replaces many of the settings formerly set by p4 counter.

p4 counters