Skip to content

Commit 2f7fa3d

Browse files
committed
added files for vesta-nginx.deb package
1 parent 184e901 commit 2f7fa3d

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

src/deb/nginx/conffiles

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/local/vesta/nginx/conf/nginx.conf

src/deb/nginx/control

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Source: vesta-nginx
2+
Package: vesta-nginx
3+
Version: 0.9.8-1
4+
Section: admin
5+
Maintainer: Serghey Rodin <skid@vestacp.com>
6+
Homepage: http://vestacp.com
7+
Architecture: amd64
8+
Depends: vesta
9+
Description: Vesta Nginx
10+
Vesta is an open source hosting control panel.
11+
Vesta has a clean and focused interface without the clutter.
12+
Vesta has the latest of very innovative technologies.
13+

src/deb/nginx/postinst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ "$1" != "configure" ]; then
6+
exit 0
7+
fi
8+
9+
# Touch and set permisions on default log files on installation
10+
update-rc.d vesta defaults >/dev/null
11+
invoke-rc.d vesta start || true

src/deb/nginx/postrm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
update-rc.d vesta remove >/dev/null 2>&1
4+
5+
6+
exit 0

src/deb/nginx/vesta

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/bin/sh
2+
3+
### BEGIN INIT INFO
4+
# Provides: vesta
5+
# internal nginx
6+
# internal php-fpm
7+
# Required-Start: $local_fs $remote_fs $network $syslog
8+
# Required-Stop: $local_fs $remote_fs $network $syslog
9+
# Default-Start: 2 3 4 5
10+
# Default-Stop: 0 1 6
11+
# Short-Description: starts the vesta control panel
12+
# Description: starts nginx and php-fpm using start-stop-daemon
13+
### END INIT INFO
14+
15+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16+
NGINX_DAEMON=/usr/local/vesta/nginx/sbin/vesta-nginx
17+
NGINX_NAME=vesta-nginx
18+
NGINX_DESC=vesta-nginx
19+
NGINX_PID=/var/run/vesta-nginx.pid
20+
21+
PHP_DAEMON=/usr/local/vesta/php/sbin/vesta-php
22+
PHP_NAME=vesta-php
23+
PHP_DESC=vesta-php
24+
PHP_PID=/var/run/vesta-php.pid
25+
26+
set -e
27+
28+
. /lib/lsb/init-functions
29+
30+
31+
start_nginx() {
32+
start-stop-daemon --start --quiet --pidfile $NGINX_PID \
33+
--retry 5 --exec $NGINX_DAEMON --oknodo
34+
}
35+
36+
start_php() {
37+
start-stop-daemon --start --quiet --pidfile $PHP_PID \
38+
--retry 5 --exec $PHP_DAEMON --oknodo
39+
}
40+
41+
stop_nginx() {
42+
start-stop-daemon --stop --quiet --pidfile $NGINX_PID \
43+
--retry 5 --oknodo --exec $NGINX_DAEMON
44+
}
45+
46+
stop_php() {
47+
start-stop-daemon --stop --quiet --pidfile $PHP_PID \
48+
--retry 5 --oknodo --exec $PHP_DAEMON
49+
}
50+
51+
case "$1" in
52+
start)
53+
log_daemon_msg "Starting $NGINX_DESC" "$NGINX_NAME"
54+
start_nginx
55+
log_end_msg $?
56+
log_daemon_msg "Starting $PHP_DESC" "$PHP_NAME"
57+
start_php
58+
log_end_msg $?
59+
;;
60+
61+
stop)
62+
log_daemon_msg "Stopping $NGINX_DESC" "$NGINX_NAME"
63+
stop_nginx
64+
log_end_msg $?
65+
log_daemon_msg "Stopping $PHP_DESC" "$PHP_NAME"
66+
stop_php
67+
log_end_msg $?
68+
;;
69+
70+
restart|force-reload|reload|configtest|testconfig)
71+
log_daemon_msg "Restarting $NGINX_DESC" "$NGINX_NAME"
72+
stop_nginx
73+
stop_php
74+
sleep 1
75+
start_nginx
76+
log_end_msg $?
77+
start_php
78+
log_end_msg $?
79+
;;
80+
81+
status)
82+
status_of_proc -p $NGINX_PID "$NGINX_DAEMON" vesta-nginx
83+
status_of_proc -p $PHP_PID "$PHP_DAEMON" vesta-php
84+
;;
85+
86+
*)
87+
echo "Usage: Vesta {start|stop|restart|status}" >&2
88+
exit 1
89+
;;
90+
esac
91+
92+
exit 0

0 commit comments

Comments
 (0)