.\" Copyright 2002 Perforce Software .\" $Id: //depot/r05.2/p4-doc/man/p4d.1#1 $ .TH P4D 1 "16 July 2002" .SH NAME p4d \- Perforce source management system server daemon .SH SYNOPSIS .B p4d [ options ] .br .B p4d [ options ] \fB-c\fP \fIcommand\fP .br .B p4d [ options ] \fB-jc\fP [\fIprefix\fI] .br .B p4d [ options ] \fB-jd\fP \fIfile\fI .br .B p4d [ options ] \fB-jj\fP [\fIprefix\fI] .br .B p4d [ options ] \fB-jr \fIfiles\fP... .br .B p4d [ options ] \fB-xr .br .B p4d [ options ] \fB-xu .br .B p4d [ options ] \fB-xv .br .B p4d -V .SH DESCRIPTION .B p4d is the server daemon and administration utility program which provides access to the Perforce source management system repository. In normal usage it listens on a specified port for connections from Perforce clients, and forks a subprocess (UNIX) or creates a thread (NT) for each such connection. .SH OPTIONS .TP .B -c \fIcommand\fP Lock the database tables, run \fIcommand\fP, unlock the tables, and exit with the same exit status as the command. .TP .B -d Fork first and then run in the background. Normally, the server runs in the foreground. UNIX only. .TP .B -f Run as a single threaded server, rather than forking processes (UNIX) or spawning threads (NT). .TP .B -h Display usage information. .TP .B -i Runs in inetd mode: it only runs once using its stdin/stdout as its client connection. UNIX only. .TP .B -jc \fIprefix\fP Checkpoint the database, and then backup and truncate the journal. Normally the checkpoint file is "checkpoint.N" (where N is a sequence number) and the backup journal file is "journal.N-1". If a \fIprefix\fP argument is given, then the names are "\fIprefix\fP.ckp.N" and "\fIprefix\fP.jnl.N-1". \fIprefix\fP is relative to the server's \fIroot\fP directory. .TP .B -jd \fIfile\fP Dumps the database to the named \fIfile\fP. This file is identical to a checkpoint file, but unlike with \fB-jc\fP the journal file is not affected and the sequence number is not changed. .TP .B -jj \fIprefix\fP Backup and truncate the journal, without checkpointing. The naming is the same as with the \fB-jc\fP flag. .TP .B -jr \fIfiles\fP... Run as the recovery utility, restoring from the checkpoint/journal \fIfiles\fR. Before restoring from a checkpoint, you need to delete the "db.*" files from the \fIroot\fR directory, as the restore operation is always incremental and a checkpoint is a full copy of the database. In general, "checkpoint.N" + "journal.N" = "checkpoint.N+1", and the last checkpoint + "journal" = the current state. \fIfiles\fR can either be given in a single invocation of \fBp4d -jr\fP or spread across multiple invocations. .TP .B -J \fIjournal\fR Set the name of the journal, overriding $P4JOURNAL and the default "journal". If set to "off", journalling is disabled. .TP .B -L \fIlog\fP Set the name of the server error log. Can also be given with $P4LOG. If not set, errors are written to standard error output. .TP .B -p \fIport\fP Listen port (default 1666) .TP .B -q Don't display startup banners. .TP .B -r \fIroot\fP Set the name of server root directory. Can also be given with $P4ROOT. No default: this must be set. .TP .B -v \fIlevel\fP Turn on server tracing to the given level. .TP .B -V Prints program version information. .TP .B -xi Switches server database to Unicode mode and quits. This option verifies that all text in the database is already valid UTF8 (or plain ASCII). Unicode mode is indicated by the "unicode" counter being set (to 1). .TP .B -xr Performs low level database check and attempts repair (Use only if you have low level database failures and no good checkpoint and journal is available) - Call Perforce Technical Support if you believe you need to use this and copy your db.xxx files before running. .TP .B -xu Upgrades database (if needed) to current server level and quits. .TP .B -xv Performs low level database integrity check .TP .B -z Causes the \fB-j\fP journalling operations to use compressed (gzip) format. The \fB-jc\fP flag writes a compressed checkpoint and saves a compressed journal, the \fB-jj\fP flag saves a compressed journal, and the \fB-jr\fP flag reads and uncompresses its input. A extra ".gz" suffix is added to generated checkpoint and journal file names. .P .SH "EXIT STATUS" .P After successful startup, .B p4d normally does not exit. On failed startup it will exit non-zero. .P If invoked with any of the .B -j journalling flags or the .B -xu database upgrade flag, .B p4d exits non-zero if any error occurs. .SH "SEE ALSO" p4(1)