Commit d933655b authored by Marco Mariani's avatar Marco Mariani

replaced SIGUSR1 with command line; replaced python wrapper with plain sh

parent ef75d65c
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
# 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 subprocess
import signal
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
...@@ -50,17 +49,23 @@ class Recipe(GenericBaseRecipe): ...@@ -50,17 +49,23 @@ class Recipe(GenericBaseRecipe):
) )
path_list.append(httpd_conf) path_list.append(httpd_conf)
wrapper = self.createPythonScript(self.options['wrapper'], wrapper = self.createWrapper(name=self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute', command=self.options['httpd-binary'],
[self.options['httpd-binary'], '-f', self.options['httpd-conf'], parameters=[
'-DFOREGROUND'] '-f',
) self.options['httpd-conf'],
'-DFOREGROUND',
])
path_list.append(wrapper) path_list.append(wrapper)
if os.path.exists(self.options['pid-file']): subprocess.call([
# Reload apache configuration self.options['httpd-binary'],
with open(self.options['pid-file']) as pid_file: '-f',
pid = int(pid_file.read().strip(), 10) self.options['httpd-conf'],
os.kill(pid, signal.SIGUSR1) # Graceful restart '-k',
'graceful',
])
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