#! /bin/sh # Copyright (c) 2000 Perforce Software Inc. All rights reserved. # # Author: Tony Smith # # Description: Perforce SysV init script for SuSE Linux. # # /etc/rc.d/init.d/p4d # . /etc/rc.config . /etc/p4d.conf return=$rc_done case "$1" in start) echo -n "Starting Perforce server (p4d)" startproc -u perforce -g perforce /usr/bin/p4d -q -d -r $P4ROOT -p $P4PORT -L $P4LOG -J $P4JOURNAL || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down Perforce Server (p4d)" killproc -TERM /usr/bin/p4d || return=$rc_failed echo -e "$return" ;; restart) $0 stop && $0 start || return=$rc_failed ;; status) checkproc /usr/bin/p4d && echo "Perforce server up" || echo "No Perforce server" ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 esac test "$return" = "$rc_done" || exit 1 exit 0