Perforce 2002.1 User's Guide | ||
<< 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 Perforce System Administrator's Guide.
The programs are available from the Downloads page on the Perforce web site:
Go to the web page, select the files for your platform, and save the files to disk.
To limit access to the Perforce server files, it is recommended that p4d be owned and run by a Perforce user account that has been created for that purpose.
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 (for instance, 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 (for instance, those that control such things as error logging, checkpointing, and journaling), can be provided. These flags (and others) are discussed in the Perforce 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 introduction of p4 admin stop in Release 99.2, the practice of manually killing the p4d server has become obsolete.
On UNIX systems, there is only one Perforce "server" program (p4d) responsible for this back-end task. On Windows, 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 (either p4s or p4d) to determine their behavior. (For instance, invoking copies named p4smyservice.exe or p4dmyserver.exe will invoke a service and a server, respectively.)
In most cases, you will want to install Perforce as a service, not a server. For a more detailed discussion of the distinction between the two options, see the Perforce System Administrator's Guide.
If you're running Perforce as a server under Windows, invoke p4d.exe from an MS-DOS command prompt. The flags under Windows are the same as those under UNIX.
If you are running Perforce 99.2 or above, whether as a service or a server, use the command
p4 admin stop
to shut down the service or server. Only a Perforce superuser may use this command.
For older revisions of Perforce, you'll have to shut down 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 2002.1 User's Guide | ||
<< Previous Chapter Reporting and Data Mining |
Table of Contents Index Perforce on the Web |
Next Chapter >> Environment Variables |