浏览代码

Se agrega inotify para chequear los cambios en la config

Espinoza Guillermo 6 年之前
父节点
当前提交
d3cc5a8472
共有 3 个文件被更改,包括 16 次插入2 次删除
  1. 2 0
      1.4.0/kea-ik/Dockerfile
  2. 3 0
      1.4.0/kea-oss/Dockerfile
  3. 11 2
      supervisord/conf.d/kea.conf

+ 2 - 0
1.4.0/kea-ik/Dockerfile

@@ -33,6 +33,8 @@ RUN eval $(ssh-agent) && ssh-add /opt/keys/bitbucket.id_rsa && git clone git@bit
 
 RUN cd kea-cm-hook && git checkout kea-test && make
 
+COPY inotify.sh /usr/local/etc/kea/inotify.sh
+
 COPY script.sh /opt/script.sh
 RUN chmod +x /opt/script.sh
 

+ 3 - 0
1.4.0/kea-oss/Dockerfile

@@ -20,6 +20,9 @@ ENV KEA_MSG_COMPILER=/usr/local/bin/kea-msg-compiler
 ENV KEA_LIB=/opt/kea/src/lib
 ENV KEA_INCLUDE=/opt/kea/src/lib
 
+RUN pip install watchdog
+RUN apt-get update && apt-get install -yq inotify-tools
+
 COPY script.sh /opt/script.sh
 RUN chmod +x /opt/script.sh
 

+ 11 - 2
supervisord/conf.d/kea.conf

@@ -4,6 +4,8 @@ redirect_stderr=true
 stdout_logfile=/dev/stdout
 stdout_logfile_maxbytes=0
 autorestart=true
+stopsignal = TERM
+stopwaitsecs = 10
 
 [program:kea-dhcp4]
 command=/usr/local/sbin/kea-dhcp4 -c /usr/local/etc/kea/kea-dhcp4.conf
@@ -11,6 +13,13 @@ redirect_stderr=true
 stdout_logfile=/dev/stdout
 stdout_logfile_maxbytes=0
 autorestart=true
+stopsignal = TERM
+stopwaitsecs = 10
 
-[program:superfsmon]
-command=superfsmon /usr/local/etc/kea/ kea-dhcp4 -r *.conf
+[program:inotify]
+command=sh /usr/local/etc/kea/inotify.sh
+redirect_stderr=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+autorestart=true
+stopwaitsecs = 10