{"id":1682,"date":"2017-12-05T12:15:03","date_gmt":"2017-12-05T12:15:03","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1682"},"modified":"2025-02-01T22:39:36","modified_gmt":"2025-02-01T22:39:36","slug":"run-perforce-server-as-a-service","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/run-perforce-server-as-a-service\/","title":{"rendered":"Run perforce Server as a Service"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Run perforce Server as a Service<\/strong><br \/>\nRun perforce Server as a Service OR boot automatically when system restart<\/p>\n<p>Template of p4d file under \/etc\/init.d<br \/>\n========================================<\/p>\n<p><code>#! \/bin\/sh<br \/>\n#<br \/>\n# chkconfig:   35 95 05<br \/>\n# description: Perforce revision control system server.<br \/>\n#<\/p>\n<p>umask 022<\/p>\n<p># Source function library.<br \/>\n. \/etc\/rc.d\/init.d\/functions<\/p>\n<p>. \/etc\/p4d.conf<\/p>\n<p>START_CMD=\"${P4D_DAEMON} -d -L $P4D_LOG -J $P4D_JOURNALS -r $P4D_ROOT -p $P4D_PO                                                                                                                     RT\"<\/p>\n<p># See how we were called.<br \/>\ncase \"$1\" in<br \/>\n  start)<br \/>\n        echo -n \"Starting p4d \"<br \/>\n        if [ ! -z \"$P4D_USER\" ]; then<br \/>\n                su - $P4D_USER -c \"$START_CMD\"<br \/>\n        else<br \/>\n                $START_CMD<br \/>\n        fi<br \/>\n        touch \/var\/lock\/subsys\/p4d<br \/>\n        ;;<br \/>\n  stop)<br \/>\n        echo -n \"Stopping p4d: \"<br \/>\n        killproc p4d<\/p>\n<p>        echo<br \/>\n        rm -f \/var\/lock\/subsys\/p4d<br \/>\n        ;;<br \/>\n  status)<br \/>\n        status p4d<br \/>\n        ;;<br \/>\n  restart)<br \/>\n        $0 stop<br \/>\n        $0 start<br \/>\n        ;;<br \/>\n  *)<br \/>\n        echo \"Usage: p4d {start|stop|status|restart}\"<br \/>\n        exit 1<br \/>\nesac<\/p>\n<p>exit 0<\/p>\n<p><\/code><\/p>\n<p>Template of p4d.conf<br \/>\n=====================================<br \/>\nP4D_ROOT=\/local\/home\/perforce\/p4root<br \/>\nP4D_DAEMON=${P4D_ROOT}\/p4d<br \/>\nP4D_LOG=${P4D_ROOT}\/logs\/p4d.log<br \/>\nP4D_JOURNALS=\/backups\/perforce_journal\/journal<br \/>\nP4D_USER=perforce<br \/>\nP4D_PORT=1666<\/p>\n<p>Add \/etc\/init.d\/p4d into chkconfig using following command&#8230;<\/p>\n<p>chkconfig &#8211;add \/etc\/init.d\/p4d<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>chander replied the topic: Re: Run perforce Server as a Service<\/strong><br \/>\nI think Services is a windows concept and method.<\/p>\n<p>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.<\/p>\n<p>To start the Perforce service:<br \/>\nContext-click on &#8220;My Computer&#8221;, and select &#8220;Manage&#8221;. The &#8220;Computer Management&#8221; window is displayed.<br \/>\nIn the right hand pane, double click on &#8220;Services and Applications&#8221;.<br \/>\nDouble click on &#8220;Services&#8221;. You now have a list of available Windows services.<br \/>\nScroll down until you see the &#8220;Perforce&#8221; service. Right click on this item and select &#8220;Start&#8221;.<\/p>\n<p>In Unix it is running as a Daemon<\/p>\n<p><strong>rajeshkumar replied the topic: Re: Run perforce Server as a Service<\/strong><br \/>\nHi chander,<\/p>\n<p>Thanks for correcting terminology and your inputs for windows&#8230;<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 ======================================== #!&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[370],"tags":[373],"class_list":["post-1682","post","type-post","status-publish","format-standard","hentry","category-perforce","tag-perforce"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1682"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1682\/revisions"}],"predecessor-version":[{"id":1683,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1682\/revisions\/1683"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}