[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Naparuba naparuba at gmail.com
Tue Feb 28 22:13:26 UTC 2012


The following commit has been merged in the debian/master branch:
commit 23332e5f3c55102cb2b30b8867e8aaaad4bfb0a3
Author: Naparuba <naparuba at gmail.com>
Date:   Fri Jan 13 10:34:49 2012 +0100

    Fix : (reported by : puisea) kill all sub process action tree on unix.

diff --git a/shinken/action.py b/shinken/action.py
index 146905a..00ff5c5 100644
--- a/shinken/action.py
+++ b/shinken/action.py
@@ -172,13 +172,18 @@ if os.name != 'nt':
                 cmd = self.command.encode('utf8', 'ignore')    
             else:
                 cmd = shlex.split(self.command.encode('utf8', 'ignore'))
+
 #            safe_print("Launching", cmd)
 #            safe_print("With env", self.local_env)
+
             # Now : GO for launch!
+            # The preexec_fn=os.setsid is set to give sons a same process group
+            # CF http://www.doughellmann.com/PyMOTW/subprocess/ for detail about this
             try:
                 self.process = subprocess.Popen(cmd,
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-                        close_fds=True, shell=force_shell, env=self.local_env)
+                        close_fds=True, shell=force_shell, env=self.local_env,
+                        preexec_fn=os.setsid)
             except OSError , exp:
                 print "Debug : Error in launching command:", self.command, exp, force_shell
                 # Maybe it's just a shell we try to exec. So we must retry
@@ -194,7 +199,9 @@ if os.name != 'nt':
                     return 'toomanyopenfiles'
 
         def kill__(self):
-            os.kill(self.process.pid, 9)
+            # We kill a process group because we launched them with preexec_fn=os.setsid and
+            # so we can launch a whole kill tree instead of just the first one
+            os.killpg(self.process.pid, 9)
   
 else:
 
diff --git a/shinken/webui/plugins_skonf/main/views/main.tpl b/shinken/webui/plugins_skonf/main/views/main.tpl
index 2fde6ac..7364393 100644
--- a/shinken/webui/plugins_skonf/main/views/main.tpl
+++ b/shinken/webui/plugins_skonf/main/views/main.tpl
@@ -2,4 +2,7 @@
 %rebase layout_skonf globals()
 <div> <h1> Rebase Layout </h1> </div>
 
-			{{!'<br>'.join(globals())}}
+<div class='discovery'><a href='/newhosts'>Add/Discover new hosts</a></div>
+<div class='pack_management'><a href='#'>Manage packs</a></div>
+<div class='architecture'><a href='#'>Manage architecture</a></div>
+<div class='modules'><a href='#'>Link with other apps</a></div>

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list