Bladeren bron

Update init.d script to allow custom service name

susefix
Ross Perkins 10 jaren geleden
bovenliggende
commit
2a679f9597
2 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  1. +1
    -0
      nginx/source.sls
  2. +7
    -7
      nginx/templates/nginx.init.jinja

+ 1
- 0
nginx/source.sls Bestand weergeven

@@ -222,6 +222,7 @@ nginx:
- group: root
- mode: 0755
- context:
service_name: {{ service_name }}
sbin_dir: {{ sbin_dir }}
pid_path: {{ pid_path }}
service:

+ 7
- 7
nginx/templates/nginx.init.jinja Bestand weergeven

@@ -1,23 +1,23 @@
#!/bin/sh

### BEGIN INIT INFO
# Provides: nginx
# Provides: {{ service_name }}
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
# Short-Description: starts the {{ service_name }} web server
# Description: starts {{ service_name }} using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON={{ sbin_dir }}/nginx
NAME=nginx
DESC=nginx
NAME={{ service_name }}
DESC={{ service_name }}

# Include nginx defaults if available
if [ -f /etc/default/nginx ]; then
. /etc/default/nginx
if [ -f /etc/default/$NAME ]; then
. /etc/default/$NAME
fi

test -x $DAEMON || exit 0

Laden…
Annuleren
Opslaan