forked from Allar/linux-perforce-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
p4dservice
46 lines (39 loc) · 922 Bytes
/
p4dservice
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/dash
#/etc/init.d/p4dservice
### BEGIN INIT INFO
# Provides: p4dservice
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and/or Stop p4d
# Description:
### END INIT INFO
export P4JOURNAL=/var/log/perforce/journal
export P4LOG=/var/log/perforce/p4err
export P4ROOT=/perforce_depot
export P4PORT=1666
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
. /lib/lsb/init-functions
p4start="p4d -d -C1"
p4stop="p4 admin stop"
p4user=perforce
case "$1" in
start)
log_action_begin_msg "Starting Perforce Server"
daemon -u $p4user -- $p4start;
;;
stop)
log_action_begin_msg "Stopping Perforce Server"
daemon -u $p4user -- $p4stop;
;;
restart)
stop
start
;;
*)
echo "Usage: /etc/init.d/p4dperforce (start|stop|restart)"
exit 1
;;
esac
exit 0