Commit 9e1711ab authored by Marco Mariani's avatar Marco Mariani

replaced 'kill -SIGUSR1' with 'httpd... reload'

parent 9e4b6641
......@@ -24,13 +24,17 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import shutil
import os
import signal
import subprocess
from binascii import b2a_uu as uuencode
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
......@@ -112,12 +116,16 @@ class Recipe(GenericBaseRecipe):
self.substituteTemplate(self.options['template'], application_conf))
path_list.append(config)
if os.path.exists(self.options['pid-file']):
# Reload apache configuration
with open(self.options['pid-file']) as pid_file:
pid = int(pid_file.read().strip(), 10)
try:
os.kill(pid, signal.SIGUSR1) # Graceful restart
except OSError:
pass
# Reload apache configuration.
# notez-bien: a graceful restart or a SIGUSR1 can somehow hang the apache threads.
subprocess.call([
self.options['httpd-binary'],
'-f',
self.options['httpd-conf'],
'-k',
'reload'
])
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