Better comments on php webapp backend

This commit is contained in:
Marc Aymerich 2015-06-16 12:39:52 +00:00
parent 5e4dead0c9
commit 5494e5b7a4
1 changed files with 6 additions and 7 deletions

View File

@ -40,7 +40,7 @@ class PHPBackend(WebAppServiceMixin, ServiceController):
self.save_fcgid(webapp, context) self.save_fcgid(webapp, context)
else: else:
raise TypeError("Unknown PHP execution type") raise TypeError("Unknown PHP execution type")
# Clean php fcgid/fpm apps in order to effectively support change of php-version self.append("# Clean non-used PHP FCGID wrappers and FPM pools")
self.delete_fcgid(webapp, context, preserve=True) self.delete_fcgid(webapp, context, preserve=True)
self.delete_fpm(webapp, context, preserve=True) self.delete_fpm(webapp, context, preserve=True)
self.set_under_construction(context) self.set_under_construction(context)
@ -72,15 +72,14 @@ class PHPBackend(WebAppServiceMixin, ServiceController):
} || { } || {
echo -e "${wrapper}" > %(wrapper_path)s echo -e "${wrapper}" > %(wrapper_path)s
if [[ %(is_mounted)i -eq 1 ]]; then if [[ %(is_mounted)i -eq 1 ]]; then
# Reload fcgid wrapper (all versions to support version changing) # Reload fcgid wrapper (All PHP versions, because of version changing support)
pkill -SIGHUP -U %(user)s "^php[0-9\.]+-cgi$" || true pkill -SIGHUP -U %(user)s "^php[0-9\.]+-cgi$" || true
fi fi
} }
""") % context chmod 550 %(wrapper_dir)s
chmod 550 %(wrapper_path)s
chown -R %(user)s:%(group)s %(wrapper_dir)s""") % context
) )
self.append("chmod 550 %(wrapper_dir)s" % context)
self.append("chmod 550 %(wrapper_path)s" % context)
self.append("chown -R %(user)s:%(group)s %(wrapper_dir)s" % context)
if context['cmd_options']: if context['cmd_options']:
self.append(textwrap.dedent("""\ self.append(textwrap.dedent("""\
# FCGID options # FCGID options
@ -96,7 +95,7 @@ class PHPBackend(WebAppServiceMixin, ServiceController):
""" ) % context """ ) % context
) )
else: else:
self.append("rm -f %(cmd_options_path)s" % context) self.append("rm -f %(cmd_options_path)s\n" % context)
def delete(self, webapp): def delete(self, webapp):
context = self.get_context(webapp) context = self.get_context(webapp)