Fix systemctl commands

This commit is contained in:
Jan Dittberner 2019-09-07 14:57:48 +02:00
parent fc544b68cd
commit 4f396c606f

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 = '/sbin/systemctl'
SERVICE_CMD = '/bin/systemctl'
INSTALL_CMD = '/usr/bin/install'
JINJAENV = Environment(loader=PackageLoader('webtasks', 'templates'))
@ -117,7 +117,7 @@ def disable_web_vhost(sitename):
SUDO_CMD, RM_CMD, "-f", _build_enabled_vhost_path(sitename)],
stderr=subprocess.STDOUT)
subprocess.check_output([
SUDO_CMD, SERVICE_CMD, 'nginx', 'reload'],
SUDO_CMD, SERVICE_CMD, 'reload', 'nginx'],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as cpe:
log_and_raise(
@ -143,7 +143,7 @@ def enable_web_vhost(sitename):
_build_enabled_vhost_path(sitename)],
stderr=subprocess.STDOUT)
subprocess.check_output([
SUDO_CMD, SERVICE_CMD, 'nginx', 'restart'],
SUDO_CMD, SERVICE_CMD, 'restart', 'nginx'],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as cpe:
log_and_raise(