r4 - 22 Jun 2008 - 08:01:37 - Main.jisooyYou are here: TWiki >  Main Web > PublicHowtos > PerforceServerSetup

Perforce server setup on Linux box

Preparation

First, determine your Linux kernel version. I'm using kernel 2.6 x64, with Fedora 9. As root, download matching perforce binaries p4 (client) and p4d (server). It's good idea to download man pages p4.1 and p4d.1 as well.

Give execute permission and move them to appropriate location, such as /usr/local/bin.

# chmod a+x p4 p4d
# mv -t /usr/local/bin p4 p4d

Copy man pages to appropriate location.

# mv -t /usr/local/share/man/man1 p4.1 p4d.1

Running Perforce daemon

You probably don't want to run p4d (the daemon) with root privilege. Let's create dedicated user account and group.

# groupadd p4admin
# useradd -g p4admin perforce 

Next, create root repository where the perforce server stores all data. I chose /usr/local/p4root

# mkdir /usr/local/p4root
# chown perforce:p4admin /usr/local/p4root

Perforce writes journal and error log, which I would like to put in /var/log/. Note that we are doing this because we are going to run the daemon with non-root privilege.

# touch /var/log/p4err /var/log/p4journal
# chown perforce:p4admin /var/log/p4err /var/log/p4journal

Now, as 'perforce', not 'root', run the following command. '-p 1666' specifies the listening port.

$ p4d -r /usr/local/p4root -J /var/log/p4journal -L /var/log/p4err -p 1666 &

Or as root, execute

# runuser -c '/usr/local/bin/p4d -r /usr/local/p4root -J /var/log/p4journal -L /var/log/p4err -p 1666' - perforce &

Check if the perforce server is running and listening to the port. Change your firewall setting as needed.

To run p4d automatically every time the system reboots, you need to hook into the system init sequence. There are many ways of doing this, but the simplest hack is to add the above command line to /etc/rc.d/rc.local file. Or you can write a full init script for perforce daemon. For example, here is my p4d init script.

To use this, copy it to /etc/rc.d/init.d, modify for your configuration, give execute permission, and run the following command.

# chkconfig --add p4d

Next time you reboot, the p4d daemon will be brought up.

Creating a depot

'depot' is the perforce equivalent of 'repository' of other SCM programs.

-- Main.jisooy - 15 Jun 2008

  • p4d: copy it to /etc/rc.d/init.d
Show attachmentsHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
elseEXT p4d manage 1.6 K 22 Jun 2008 - 07:57 Main.jisooy copy it to /etc/rc.d/init.d
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions

tip TWiki Tip of the Day
Linking to a file attachment
One can create a link to a file attachment using one of the following TWikiVariables, %ATTACHURL% or ... Read on Read more

 
Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback