Merge branch 'hotfix/0.1.4' into production

* hotfix/0.1.4:
  Fix reload, use systemctl instead of service
This commit is contained in:
Jan Dittberner 2019-09-07 14:46:57 +02:00
commit 2ef6cc1ca6

View file

@ -21,7 +21,7 @@ _LOGGER = get_task_logger(__name__)
SUDO_CMD = '/usr/bin/sudo' SUDO_CMD = '/usr/bin/sudo'
RM_CMD = '/bin/rm' RM_CMD = '/bin/rm'
LN_CMD = '/bin/ln' LN_CMD = '/bin/ln'
SERVICE_CMD = '/usr/sbin/service' SERVICE_CMD = '/sbin/systemctl'
INSTALL_CMD = '/usr/bin/install' INSTALL_CMD = '/usr/bin/install'
JINJAENV = Environment(loader=PackageLoader('webtasks', 'templates')) JINJAENV = Environment(loader=PackageLoader('webtasks', 'templates'))
@ -198,9 +198,6 @@ def create_web_php_fpm_pool_config(username):
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
subprocess.check_output([ subprocess.check_output([
SUDO_CMD, RM_CMD, filename], stderr=subprocess.STDOUT) SUDO_CMD, RM_CMD, filename], stderr=subprocess.STDOUT)
subprocess.check_output([
SUDO_CMD, SERVICE_CMD, 'php5-fpm', 'reload'],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as cpe: except subprocess.CalledProcessError as cpe:
log_and_raise(cpe, 'could not configure PHP FPM for %s', username) log_and_raise(cpe, 'could not configure PHP FPM for %s', username)
return True return True
@ -220,9 +217,6 @@ def delete_web_php_fpm_pool_config(username):
subprocess.check_output([ subprocess.check_output([
SUDO_CMD, RM_CMD, "-f", _build_php_fpm_pool_file(username)], SUDO_CMD, RM_CMD, "-f", _build_php_fpm_pool_file(username)],
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
subprocess.check_output([
SUDO_CMD, SERVICE_CMD, 'php5-fpm', 'reload'],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as cpe: except subprocess.CalledProcessError as cpe:
log_and_raise( log_and_raise(
cpe, 'could not delete PHP FPM configuration for %s', username) cpe, 'could not delete PHP FPM configuration for %s', username)