Fix reload, use systemctl instead of service

This commit is contained in:
Jan Dittberner 2019-09-07 14:43:53 +02:00
parent 636372506a
commit e1dd3295c1
1 changed files with 1 additions and 7 deletions

View File

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