Переглянути джерело

feat(api,ns*): make pdns, cron, and uwsgi direct children of init

Co-authored-by: Nils Wisiol <nils@desec.io>
Peter Thomassen 6 роки тому
батько
коміт
bbcad8c303
3 змінених файлів з 7 додано та 4 видалено
  1. 5 2
      api/entrypoint.sh
  2. 1 1
      nslord/entrypoint.sh
  3. 1 1
      nsmaster/entrypoint.sh

+ 5 - 2
api/entrypoint.sh

@@ -5,10 +5,13 @@ echo "waiting for dependencies ..."
 ./wait
 
 # start cron
-/root/cronhook/start-cron.sh &
+# Start child process that starts grand-child process.
+# After the child process's death, the grand-child will be adopted by init.
+# See https://stackoverflow.com/a/20338327
+( /root/cronhook/start-cron.sh & )
 
 # migrate database
 python manage.py migrate || exit 1
 
 echo Finished migrations, starting API server ...
-uwsgi --ini uwsgi.ini
+exec uwsgi --ini uwsgi.ini

+ 1 - 1
nslord/entrypoint.sh

@@ -5,4 +5,4 @@ host=dblord; port=3306; n=120; i=0; while ! (echo > /dev/tcp/$host/$port) 2> /de
 # Manage credentials
 envsubst < /etc/powerdns/pdns.conf.var > /etc/powerdns/pdns.conf
 
-pdns_server --daemon=no
+exec pdns_server --daemon=no

+ 1 - 1
nsmaster/entrypoint.sh

@@ -5,4 +5,4 @@ host=dbmaster; port=3306; n=120; i=0; while ! (echo > /dev/tcp/$host/$port) 2> /
 # Manage credentials
 envsubst < /etc/powerdns/pdns.conf.var > /etc/powerdns/pdns.conf
 
-pdns_server --daemon=no
+exec pdns_server --daemon=no