Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Run perforce Server as a Service

rajeshkumar created the topic: Run perforce Server as a Service
Run perforce Server as a Service OR boot automatically when system restart

Template of p4d file under /etc/init.d
========================================

#! /bin/sh
#
# chkconfig: 35 95 05
# description: Perforce revision control system server.
#

umask 022

# Source function library.
. /etc/rc.d/init.d/functions

. /etc/p4d.conf

START_CMD="${P4D_DAEMON} -d -L $P4D_LOG -J $P4D_JOURNALS -r $P4D_ROOT -p $P4D_PO RT"

# See how we were called.
case "$1" in
start)
echo -n "Starting p4d "
if [ ! -z "$P4D_USER" ]; then
su - $P4D_USER -c "$START_CMD"
else
$START_CMD
fi
touch /var/lock/subsys/p4d
;;
stop)
echo -n "Stopping p4d: "
killproc p4d

echo
rm -f /var/lock/subsys/p4d
;;
status)
status p4d
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: p4d {start|stop|status|restart}"
exit 1
esac

exit 0

Template of p4d.conf
=====================================
P4D_ROOT=/local/home/perforce/p4root
P4D_DAEMON=${P4D_ROOT}/p4d
P4D_LOG=${P4D_ROOT}/logs/p4d.log
P4D_JOURNALS=/backups/perforce_journal/journal
P4D_USER=perforce
P4D_PORT=1666

Add /etc/init.d/p4d into chkconfig using following command…

chkconfig –add /etc/init.d/p4d
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

chander replied the topic: Re: Run perforce Server as a Service
I think Services is a windows concept and method.

To run perforce as a service the Perforce Server should be installed as a Windows service. Then an Administrator privileges can start and stop it using the Services dialog in the Control Panel.

To start the Perforce service:
Context-click on “My Computer”, and select “Manage”. The “Computer Management” window is displayed.
In the right hand pane, double click on “Services and Applications”.
Double click on “Services”. You now have a list of available Windows services.
Scroll down until you see the “Perforce” service. Right click on this item and select “Start”.

In Unix it is running as a Daemon

rajeshkumar replied the topic: Re: Run perforce Server as a Service
Hi chander,

Thanks for correcting terminology and your inputs for windows…
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x