forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvesta.init
More file actions
executable file
·101 lines (86 loc) · 2.03 KB
/
Copy pathvesta.init
File metadata and controls
executable file
·101 lines (86 loc) · 2.03 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh
#
# nginx
# php-fpm
#
# chkconfig: - 85 15
# description: Run vesta web server
# processname: vesta
. /etc/rc.d/init.d/functions
# Vesta PATH
. /etc/profile.d/vesta.sh
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/vesta/nginx/sbin/vesta-nginx"
nignx_conf="/usr/local/vesta/nginx/conf/nginx.conf"
php="/usr/local/vesta/php/sbin/vesta-php"
php_conf="/usr/local/vesta/php/etc/php-fpm.conf"
vesta_user=admin
vesta_group=admin
start() {
[ -x $nginx ] || exit 5
[ -f $nignx_conf ] || exit 6
[ -x $php ] || exit 1
[ -f $php_conf ] || exit 2
echo -n $"Starting vesta-nginx: "
daemon $nginx
retval=$?
echo
[[ $retval -ne 0 ]] && exit $retval
echo -n $"Starting vesta-php: "
daemon $php
echo
return $retval
}
stop() {
echo -n $"Stopping vesta-nginx: "
killproc -p /var/run/vesta-nginx.pid vesta-nginx -QUIT
retval=$?
echo
[ -f ${pidfile} ] && /bin/rm -f ${pidfile}
[[ $retval -ne 0 ]] && exit $retval
echo -n $"Stopping vesta-php: "
killproc -p /var/run/vesta-php.pid vesta-php -QUIT
retval=$?
echo
[ -f /var/run/vesta-php.pid ] && /bin/rm -f /var/run/vesta-php.pid
[ -f /var/run/vesta-php.sock ] && /bin/rm -f /var/run/vesta-php.sock
return $retval
}
restart(){
stop
start
}
reload() {
echo -n $"Reloading vesta-nginx: "
killproc -p /var/run/vesta-nginx.pid vesta-nginx -USR2
retval=$?
echo
[[ $retval -ne 0 ]] && exit $retval
echo -n $"Reloading vesta-php: "
killproc -p /var/run/vesta-php.pid vesta-php -USR2
retval=$?
echo
return $retval
}
rh_status(){
status -p /var/run/vesta-nginx.pid vesta-nginx
status -p /var/run/vesta-php.pid vesta-php
}
case "$1" in
start)
start;;
stop)
stop;;
restart)
restart;;
reload)
reload;;
status)
rh_status;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 3
esac