Commit 41b42af9 authored by Antoine Catton's avatar Antoine Catton

Add SIGHUP to stunnel recipe in order to reload stunnel configuration.

parent 4ea644e8
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os
import signal
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
...@@ -46,7 +49,6 @@ class Recipe(GenericBaseRecipe): ...@@ -46,7 +49,6 @@ class Recipe(GenericBaseRecipe):
pid_file = self.options['pid-file'] pid_file = self.options['pid-file']
conf.update(pid_file=pid_file) conf.update(pid_file=pid_file)
path_list.append(pid_file)
log_file = self.options['log-file'] log_file = self.options['log-file']
conf.update(log=log_file) conf.update(log=log_file)
...@@ -72,4 +74,10 @@ class Recipe(GenericBaseRecipe): ...@@ -72,4 +74,10 @@ class Recipe(GenericBaseRecipe):
) )
path_list.append(wrapper) path_list.append(wrapper)
if os.path.exists(pid_file):
with open(pid_file, 'r') as file_:
pid = file_.read().strip()
# Reload configuration
os.kill(int(pid, 10), signal.SIGHUP)
return path_list return path_list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment