Add dnsmasq so nginx will allow an upstream service to not block startup
This commit is contained in:
parent
9affe193db
commit
16ec19d356
8 changed files with 27 additions and 7 deletions
|
@ -6,6 +6,7 @@ import yaml
|
|||
import jinja2
|
||||
|
||||
|
||||
|
||||
def generate_nginx_config():
|
||||
"""
|
||||
Generates nginx config from the app config
|
||||
|
@ -41,6 +42,7 @@ def generate_server_config(config):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
config = yaml.load(file('conf/stack/config.yaml', 'r'))
|
||||
generate_server_config(config)
|
||||
generate_nginx_config()
|
||||
with open('conf/stack/config.yaml', 'r') as f:
|
||||
config = yaml.load(f)
|
||||
generate_server_config(config)
|
||||
generate_nginx_config()
|
||||
|
|
7
conf/init/service/dnsmasq/log/run
Executable file
7
conf/init/service/dnsmasq/log/run
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Ensure dependencies start before the logger
|
||||
sv check syslog-ng > /dev/null || exit 1
|
||||
|
||||
# Start the logger
|
||||
exec logger -i -t dnsmasq
|
7
conf/init/service/dnsmasq/run
Executable file
7
conf/init/service/dnsmasq/run
Executable file
|
@ -0,0 +1,7 @@
|
|||
#! /bin/bash
|
||||
|
||||
echo 'Starting dnsmasq'
|
||||
|
||||
/usr/sbin/dnsmasq --no-daemon --user=root --listen-address=127.0.0.1
|
||||
|
||||
echo 'dnsmasq'
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
echo 'Starting nginx'
|
||||
|
||||
NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' '`
|
||||
echo "resolver $NAMESERVER valid=10s;" > /conf/nginx/resolver.conf
|
||||
|
||||
/usr/sbin/nginx -c /conf/nginx/nginx.conf
|
||||
|
||||
echo 'Nginx exited'
|
||||
|
|
Reference in a new issue