Perforce 2000.2 Command Line User's Guide (2000.2.ug.1) | ||
<< Previous Chapter Reporting and Data Mining |
Table of Contents Index Perforce on the Web |
Next Chapter >> Environment Variables |
This appendix is mainly intended for people installing an evaluation copy of Perforce for trial use; if you're installing Perforce for production use, or are planning on extensive testing of your evaluation server, we strongly encourage you to read the detailed information in the System Administrator's Guide.
Although p4 and p4d can be installed in any directory, on UNIX the Perforce client program typically resides in /usr/local/bin, and the Perforce server is usually located either in /usr/local/bin or in its own server root directory. Perforce client programs can be installed on any machine that has TCP/IP access to the p4d host.
To limit access to the Perforce server files, we recommend that p4d be owned and run by a Perforce user account created specifically for running Perforce.
Only a few additional steps need to be performed before p4 and p4d can be run. They are described in detail in the following sections. Briefly:
For security purposes, read and write access to the server root should be restricted to prevent anyone but the account owner from reading, modifying or even listing the actual depot files. To ensure that temporary files cannot be read by unauthorized users, set the umask(1) file creation-mode mask of the account owner to a value that will not permit other users to read the contents of the server root directory or its files.
For security purposes, you are strongly advised not to run p4d as root or any other privileged user.
The environment variable P4ROOT should be set to point to the server root. Alternatively, the -r root_dir flag can be provided when p4d is started to specify a server root directory. The Perforce client programs never use this directory directly, and do not need to know the value of P4ROOT; the p4d server is the only process which uses the P4ROOT environment variable.
Unlike P4ROOT, the environment variable P4PORT is used by both the Perforce server and Perforce clients, and should be set on both. Its use is discussed in the next two sections.
If p4d is to listen on a different port, the port can be specified with the -p port_num flag when starting p4d (e.g. p4d -p 1818), or the port can be set with the P4PORT environment or registry variable.
p4d &
Although this command is sufficient to run p4d, other flags (e.g., those that control such things as error logging, checkpointing, and journaling), can be provided. These flags (and others) are discussed in the System Administrator's Guide.
p4 admin stop
to shut down the Perforce server.
If you are running an earlier version of Perforce, you'll have to find the process ID of the p4d server and kill it manually from the UNIX shell. The use of kill -15 (SIGTERM) is preferable to kill -9 (SIGKILL), as the database could be left in an inconsistent state if p4d happened to be in the middle of updating a file when a SIGKILL signal was received.
With the appearance of p4 admin stop in Release 99.2, the practice of manually killing the p4d server has become obsolete.
The Perforce installer (perforce.exe) allows you to:
On UNIX systems, there is only one Perforce "server" program (p4d) responsible for this back-end task. On NT, however, this back-end program can be started either as an NT service (p4s.exe), which can be set to run at boot time, or as an NT server (p4d.exe), which is invoked from an MS-DOS prompt.
The Perforce service (p4s.exe) and the Perforce server (p4d.exe) executables are copies of each other; they are identical apart from their filenames. When run, they use the first three characters of the name with which they were invoked (i.e. either p4s or p4d) to determine their behavior. (i.e. invoking copies named p4smyserver.exe or p4dmyservice.exe will invoke a service and a server, respectively.)
In most cases (i.e., for production use), you will want to install Perforce as a service, not a server. For evaluation purposes, you may with to install it as a server and invoke it from the MS-DOS command line as required.
If you're running Perforce as a server under NT, invoke it from an MS-DOS command prompt. The flags under NT are the same as those under UNIX.
If you are running Perforce 99.2, whether as a service or a server under NT, use the command
p4 admin stop
to shut down a 99.2 NT service or server.
For older revisions of Perforce, you'll have to shut down NT services by using the Services applet in the Control Panel., and servers running in MS-DOS windows by typing Ctrl-C in the window or clicking on the icon to Close the window.
While these options will work with both Release 99.2 and earlier versions of Perforce, they are not necessarily "clean", in the sense that the server or service is shut down abruptly. With the availability of the p4 admin stop command in 99.2, their use is no longer recommended.
Perforce 2000.2 Command Line User's Guide (2000.2.ug.1) | ||
<< Previous Chapter Reporting and Data Mining |
Table of Contents Index Perforce on the Web |
Next Chapter >> Environment Variables |