4 Commits 7baef2441d ... de66afdef8

Author SHA1 Message Date
  Baptiste Jonglez de66afdef8 Fix build with older compilers 6 years ago
  Baptiste Jonglez d620c666c6 Release 1.2.0 6 years ago
  zorun 3640941052 Merge pull request #7 from salanki/master 6 years ago
  Peter Salanki 241e8a72cd Add signal handler to avoid zombies in non-wait mode 6 years ago
3 changed files with 9 additions and 3 deletions
  1. 2 2
      CHANGELOG.md
  2. 1 1
      Makefile
  3. 6 0
      src/load.cc

+ 2 - 2
CHANGELOG.md

@@ -1,8 +1,8 @@
 # Changelog for kea-hook-runscript
 
-## unreleased
+## 1.2.0 (2019-01-24)
 
-- allow to run the script asynchronously (wait=false)
+- Allow to run the script asynchronously (by setting `wait=false`, see `README`)
 
 ## 1.1.0 (2017-10-22)
 

+ 1 - 1
Makefile

@@ -5,7 +5,7 @@ KEA_LIB ?= /usr/lib
 
 OBJECTS = src/messages.o src/logger.o src/load.o src/runscript.o src/callouts.o src/version.o
 DEPS = $(OBJECTS:.o=.d)
-CXXFLAGS = -I $(KEA_INCLUDE) -fPIC -Wno-deprecated
+CXXFLAGS = -I $(KEA_INCLUDE) -fPIC -Wno-deprecated -std=c++11
 LDFLAGS = -L $(KEA_LIB) -shared -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions
 
 kea-hook-runscript.so: $(OBJECTS)

+ 6 - 0
src/load.cc

@@ -1,3 +1,4 @@
+#include <signal.h>
 #include <hooks/hooks.h>
 
 #include "logger.h"
@@ -39,6 +40,11 @@ int load(LibraryHandle& handle) {
        script_wait = wait->boolValue();
     }
 
+     /* Install signal handler for non-wait case to avoid leaving  zombie processes around */
+     if (!script_wait) {
+        signal(SIGCHLD, SIG_IGN);
+     }
+
     return 0;
 }