README #1

  • //
  • guest/
  • perforce_software/
  • p4dctl/
  • main/
  • README
  • View
  • Commits
  • Open Download .zip Download (2 KB)
			P4DCTL README
			-------------

P4DCTL is a program for starting and stopping Perforce services on Unix 
platforms. It's designed to be used both by root and non-root users and
to integrate well with init.d or rc scripts for boot/shutdown. It allows
the system administrator to specify the Perforce services they wish to
start on the box in a single configuration file: /etc/perforce/p4dctl.conf, 
or in a set of configuration files under /etc/perforce/p4dctl.conf.d

BUILDING FROM SOURCE
--------------------

If you're building inside Perforce, you can just sync the P4 tree as
well as p4dctl and use jam.

If you're building from the Public Depot sources, you'll need Perforce 
Jam, and the Perforce API. Once you've installed both, simply use:

	jam -sP4=<path to Perforce API>

You may also wish to specify your operating system version. For example, for 
a Linux 2.6 build, I might use:

	jam -sP4=<path to Perforce API> -sOSVER=26 

Then to install the binary, run the command below as root:

	jam -sP4=<path to Perforce API> -sOSVER=<version> install

This will install the binary in /usr/local/bin and make it a setuid root
executable. I believe the program to be secure, though obviously I can't
guarantee that.

INSTALLING A PRE-BUILT BINARY
-----------------------------

If you're using a pre-built binary, just copy it into /usr/local/bin, and run
the following commands:

	chown root:0 /usr/local/bin/p4dctl
	chmod 4711 /usr/local/bin/p4dctl

CONFIGURATION
-------------

The simplest way to get started is to copy the p4dctl.conf.sample from the 
distribution to /etc/perforce/p4dctl.conf and edit it to reflect your needs.

USAGE
-----

See 'p4dctl -h' for command-line syntax
# Change User Description Committed
#1 16543 Matt Attaway Update P4DCTL with code from 15.2 and reorg files
//guest/perforce_software/p4dctl/src/README
#2 10658 Jason Gibson Update P4DCTL from internal Perforce tree.

Note that this change does not bring the internal Jam files and deletes the
existing builds, leaving that as a future task.

Changes include:

################################################################################

       Added support for a -o option which allows command line arguments to be passed
       directly to the service being started.

################################################################################

       Support for P4DTG in P4DCTL.

       Example config:

       p4dtg test {
         Execute =  /usr/local/share/p4dtg-2010.2.452775/p4dtg-repl
         Owner   =  perforce

         Environment
         {
           P4DTGROOT    = /p4/dtg
           P4DTGMAPPING = local
         }
       }

################################################################################

Move p4dctl's default configuration file (and the only one that is considered
safe to use) to '/etc/perforce/p4dctl.conf', and also move the directory that
gets included by default to '/etc/perforce/p4dctl.conf.d'.

################################################################################

Make p4dctl provide LANG and LC_ALL environment variables to child processes.
These both default to 'C'. They can be overridden in either global or
server-specific environment blocks, but given that 2014.2 relies on LANG, it's
better if that is set than missing.

################################################################################

       Make p4dctl status exit with a code of 1 if any of the servers
       that it attempts to check are not running. For automation
       support

################################################################################

Change syntax of p4dctl config files so as to more clearly differentiate
between 'settings' that p4dctl understands and environment variables to be set
for the child processes.

       The old style syntax looked like this:

       p4d main
       {
           Owner       = perforce
           Execute     = /usr/local/bin/p4d

           P4ROOT      = /home/perforce/p4-main
           P4JOURNAL   = journal
           P4PORT      = 1666
           PATH        = /bin:/usr/bin:/usr/local/bin
       }

       Where the only thing that differentiated the two was a convention on the use of
case. Anything p4dctl didn't understand would be set as an environment variable.

       Now, we're separating the environment into a dedicated block, so p4dctl can
flag up early if it encounters settings it doesn't know about.

       The new syntax looks like this:

       p4d main
       {
           Owner       = perforce
           Execute     = /usr/local/bin/p4d

           Environment
           {
               P4ROOT      =   /home/perforce/p4-main
               P4JOURNAL   =   journal
               P4PORT      =   1666
               PATH        =   /bin:/usr/bin:/usr/local/bin
           }
       }

################################################################################

A new command in p4dctl that allows you to query the environment for any
configured server.

       For example: list all p4d's with their Name, port and root:

         $ p4dctl env -a -t p4d Name P4PORT P4ROOT
         Name=p4d-master P4PORT=ssl:1666 P4ROOT=/var/lib/perforce/p4d-master

       Find the P4ROOT of a known Perforce server and set P4ROOT in your
       environment:

         $ eval `p4dctl env -t p4d p4d-master P4ROOT`

################################################################################

Manpages for p4dctl and its config file.

################################################################################

       Add 'list' command to p4dctl. Lists configured servers
       visible to the current user.

       Lists useful information about all the standard Perforce
       Server types.
#1 8907 Matt Attaway Branch Tony Smith's p4dctl tool into perforce_software area

p4dctl is a tool that helps admins to manage multiple Perforce servers. This
tool is used by the Perforce Linux packages to help manage servers.
//guest/tony_smith/perforce/p4dctl/src/README
#2 8326 Tony Smith Some significant updates to p4dctl.

1. Support for interacting with SSL enabled servers
2. New command 'list' to list configured servers

      p4dctl [ options ] list [ -t type ] -a
             p4dctl [ options ] list [ -t type ] servername

3. New command 'env' to allow you to fetch arbitrary
   settings from a configured server in a form suitable for use
   with 'eval'.

    p4dctl [ options ] env [ -t type ] -a var [ var...  ]
    p4dctl [ options ] env [ -t type ] servername var [ var...  ]

4. Supply a new manpage for p4dctl
#1 5945 Tony Smith Release p4dctl, a program for starting/stopping Perforce services
on Unix operating systems. Similar to, and developed in concert
with, Sven Erik Knop's p4dcfg.

For example:

    p4dctl start -a

Can start multiple P4D, P4P, P4Web, or P4FTP servers in one easy
command line. It can be executed by root, or by the 'owners' of
the configured services and it maintains pidfiles no matter who
uses it (so they remain accurate).

An init script using p4dctl will typically just use:

    p4dctl start -a
    p4dctl stop -a
    p4dctl restart -a

And check the exit status.