Install Perforce on Ubunto

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/bin
wget http://www.perforce.com/downloads/perforce/r10.2/bin.linux26x86/p4d
wget 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 /perforce
sudo chown perforce /perforce
sudo mkdir /perforce/log
sudo 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 Settings
export P4JOURNAL=/perforce/log/journal
export P4LOG=/perforce/log/p4err
export P4ROOT=/perforce
export P4PORT=localhost:1666
export 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 -e
 
export P4JOURNAL=/perforce/log/journal
export P4LOG=/perforce/log/p4err
export P4ROOT=/perforce
export P4PORT=localhost:1666
 
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
 
p4user=perforce
p4start="p4d -d -r $P4ROOT -J $P4JOURNAL -L $P4LOG -p $P4PORT"
p4stop="p4 -Hlocalhost -p$P4PORT -u$p4user admin stop"
 
case "$1" in
start)
echo "STARTING PERFORCE SERVER...."
$p4start;
;;
stop)
echo "STOPING PERFORCE SERVER...."
$p4stop;
;;
restart)
echo "STOPING PERFORCE SERVER....."
$p4stop
echo "STARTING PERFORCE SERVER...."
$p4start
;;
*)
echo "Usage: /etc/init.d/perforce (start|stop|restart)"
exit 1
;;
esac
exit 0

转载于:https://www.cnblogs.com/Magicworks/archive/2011/08/16/2141340.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值