Configure Perforce
- Download the Perforce daemon file 'p4d' and client 'p4' files directly into /usr/local/bin. These files are for Linux installs using the 2.6 kernel version.
cd /usr/local/binwget http://www.perforce.com/downloads/perforce/r10.2/bin.linux26x86/p4dwget http://www.perforce.com/downloads/perforce/r10.2/bin.linux26x86/p4
- Make the 'p4d' and 'p4' files executable.
chmod +x p4d p4
- Create a directory to hold Perforce files.
sudo mkdir /perforcesudo chown perforce /perforcesudo mkdir /perforce/logsudo chown perforce /perforce/log
- Add the following lines to the end of /etc/profile. These settings will be used by local client programs run on the Linux server – not by the Perforce server.
# Perforce Settingsexport P4JOURNAL=/perforce/log/journalexport P4LOG=/perforce/log/p4errexport P4ROOT=/perforceexport P4PORT=localhost:1666export P4USER=perforce
- Load the Perforce settings.
source /etc/profile
Setup Perforce As Bootup Service
- Change to the initialization control directory.
cd /etc/init.d
- Create the Perforce control script using 'sudo vi perforce'.
#!/bin/sh -eexport P4JOURNAL=/perforce/log/journalexport P4LOG=/perforce/log/p4errexport P4ROOT=/perforceexport P4PORT=localhost:1666PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"p4user=perforcep4start="p4d -d -r $P4ROOT -J $P4JOURNAL -L $P4LOG -p $P4PORT"p4stop="p4 -Hlocalhost -p$P4PORT -u$p4user admin stop"case "$1" instart)echo "STARTING PERFORCE SERVER...."$p4start;;;stop)echo "STOPING PERFORCE SERVER...."$p4stop;;;restart)echo "STOPING PERFORCE SERVER....."$p4stopecho "STARTING PERFORCE SERVER...."$p4start;;*)echo "Usage: /etc/init.d/perforce (start|stop|restart)"exit 1;;esacexit 0