diff options
author | stephen.arnold42 <stephen.arnold42@gmail.com> | 2013-12-04 02:33:34 -0800 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-12-09 17:51:20 +0000 |
commit | c6e1be52b71c9c234de6aebd036a0e7898a89338 (patch) | |
tree | 5391ab4e8e640282d6a7d509dca39c8df9b5cf4d /meta-webserver/recipes-httpd/nginx/files/nginx.init | |
parent | 98bfe33760acb74b67eba9d58ea7cac8cad6d810 (diff) | |
download | meta-openembedded-c6e1be52b71c9c234de6aebd036a0e7898a89338.tar.gz |
nginx: new recipe
Initial recipe created by Steve Arnold. Original build patch and 1.0.10
recipe graciously contributed by bencoh (in #oe on irc.freenode.net).
New recipe and init script contributed by this author. Built and
tested on master branches using author's fork of meta-raspberrypi.
Signed-off-by: stephen.arnold42 <stephen.arnold42@gmail.com>
Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-webserver/recipes-httpd/nginx/files/nginx.init')
-rwxr-xr-x | meta-webserver/recipes-httpd/nginx/files/nginx.init | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.init b/meta-webserver/recipes-httpd/nginx/files/nginx.init new file mode 100755 index 000000000..0f38b9cdb --- /dev/null +++ b/meta-webserver/recipes-httpd/nginx/files/nginx.init | |||
@@ -0,0 +1,52 @@ | |||
1 | #! /bin/sh | ||
2 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
3 | DAEMON=/usr/sbin/nginx | ||
4 | NAME=nginx | ||
5 | DESC=nginx | ||
6 | PID=/var/run/nginx/nginx.pid | ||
7 | |||
8 | test -x $DAEMON || exit 0 | ||
9 | |||
10 | # Include nginx defaults if available | ||
11 | if [ -f /etc/default/nginx ] ; then | ||
12 | . /etc/default/nginx | ||
13 | fi | ||
14 | |||
15 | set -e | ||
16 | |||
17 | case "$1" in | ||
18 | start) | ||
19 | echo -n "Starting $DESC: " | ||
20 | start-stop-daemon --start --quiet --pidfile $PID \ | ||
21 | --name $NAME --exec $DAEMON -- $DAEMON_OPTS | ||
22 | echo "$NAME." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "Stopping $DESC: " | ||
26 | start-stop-daemon -K --quiet --pidfile $PID \ | ||
27 | --name $NAME | ||
28 | echo "$NAME." | ||
29 | ;; | ||
30 | restart|force-reload) | ||
31 | echo -n "Restarting $DESC: " | ||
32 | start-stop-daemon -K --quiet --pidfile $PID \ | ||
33 | --name $NAME | ||
34 | sleep 1 | ||
35 | start-stop-daemon --start --quiet --pidfile $PID \ | ||
36 | --name $NAME --exec $DAEMON -- $DAEMON_OPTS | ||
37 | echo "$NAME." | ||
38 | ;; | ||
39 | reload) | ||
40 | echo -n "Reloading $DESC configuration: " | ||
41 | start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \ | ||
42 | --exec $DAEMON | ||
43 | echo "$NAME." | ||
44 | ;; | ||
45 | *) | ||
46 | N=/etc/init.d/$NAME | ||
47 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | ||
48 | exit 1 | ||
49 | ;; | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||