#! /bin/sh # # p4d Start the p4d daemon # # Author: Tony Smith # # chkconfig: 345 85 15 # description: Starts the Perforce server process # # processname: p4d # config: /etc/p4d.conf # Some junk to make the rc script behave # daemon - makes rc startup work properly # killproc - makes rc shutdown work properly # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 # See how we were called. case "$1" in start) echo -n "Starting Perforce server: " su - perforce -c ". /etc/p4d.conf; p4d -d" > /dev/null touch /var/lock/subsys/p4d echo_success echo ;; stop) echo -n "Stopping Perforce server: " su - perforce -c ". /etc/p4d.conf; p4 admin stop" >/dev/null rm /var/lock/subsys/p4d echo_success echo ;; status) status p4d RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: p4d {start|stop|status|restart}" exit 1 esac exit $REVAL