2018-11-13 21:55:59 +01:00
|
|
|
"""WordOps Service Manager"""
|
|
|
|
|
import subprocess
|
2019-09-04 20:36:15 +02:00
|
|
|
|
2018-11-13 21:55:59 +01:00
|
|
|
from wo.core.logging import Log
|
2019-07-29 04:10:47 +02:00
|
|
|
|
2018-11-13 21:55:59 +01:00
|
|
|
|
|
|
|
|
class WOService():
|
|
|
|
|
"""Intialization for service"""
|
|
|
|
|
def ___init__():
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def start_service(self, service_name):
|
|
|
|
|
"""
|
|
|
|
|
start service
|
|
|
|
|
Similar to `service xyz start`
|
|
|
|
|
"""
|
|
|
|
|
try:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if service_name in ['lsws']:
|
|
|
|
|
Log.wait(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
sub = subprocess.Popen(
|
|
|
|
|
'/usr/local/lsws/bin/openlitespeed -t',
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE, shell=True)
|
2019-12-03 19:48:18 +01:00
|
|
|
output = sub.communicate()
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if sub.returncode == 0:
|
|
|
|
|
Log.valide(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
Log.wait(self, "Starting OpenLiteSpeed")
|
|
|
|
|
service_cmd = ('/usr/local/lsws/bin/lswsctrl start')
|
2019-08-27 10:20:25 +02:00
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
2019-08-27 12:32:48 +02:00
|
|
|
if retcode[0] == 0:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.valide(self, "Starting OpenLiteSpeed ")
|
2019-08-27 12:32:48 +02:00
|
|
|
return True
|
2019-12-03 19:48:18 +01:00
|
|
|
else:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.failed(self, "Starting OpenLiteSpeed")
|
2019-08-27 10:20:25 +02:00
|
|
|
else:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.failed(self, "Testing OpenLiteSpeed configuration ")
|
2019-08-27 10:20:25 +02:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
else:
|
|
|
|
|
service_cmd = ('service {0} start'.format(service_name))
|
|
|
|
|
|
2019-08-27 10:20:25 +02:00
|
|
|
Log.info(self, "Start : {0:10}" .format(service_name), end='')
|
|
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
|
|
|
|
if retcode[0] == 0:
|
2019-09-05 12:06:28 +02:00
|
|
|
Log.info(self, "[" + Log.ENDC + Log.OKGREEN +
|
|
|
|
|
"OK" + Log.ENDC + Log.OKBLUE + "]")
|
2019-08-27 10:20:25 +02:00
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
2019-10-30 04:23:20 +01:00
|
|
|
Log.info(self, "[" + Log.FAIL +
|
|
|
|
|
"Failed" + Log.OKBLUE + "]")
|
2019-08-27 10:20:25 +02:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
except OSError as e:
|
|
|
|
|
Log.debug(self, "{0}".format(e))
|
|
|
|
|
Log.error(self, "\nFailed to start service {0}"
|
|
|
|
|
.format(service_name))
|
|
|
|
|
|
|
|
|
|
def stop_service(self, service_name):
|
|
|
|
|
"""
|
|
|
|
|
Stop service
|
|
|
|
|
Similar to `service xyz stop`
|
|
|
|
|
"""
|
|
|
|
|
try:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if service_name in ['lsws']:
|
|
|
|
|
Log.info(self, "Stop : {0:10}" .format(service_name), end='')
|
|
|
|
|
retcode = subprocess.getstatusoutput(
|
|
|
|
|
'/usr/local/lsws/bin/lswsctrl stop')
|
|
|
|
|
else:
|
|
|
|
|
Log.info(self, "Stop : {0:10}" .format(service_name), end='')
|
|
|
|
|
retcode = subprocess.getstatusoutput('service {0} stop'
|
|
|
|
|
.format(service_name))
|
2018-11-13 21:55:59 +01:00
|
|
|
if retcode[0] == 0:
|
2019-09-05 12:01:33 +02:00
|
|
|
Log.info(self, "[" + Log.ENDC + Log.OKGREEN + "OK" +
|
2019-09-05 11:59:57 +02:00
|
|
|
Log.ENDC + Log.OKBLUE + "]")
|
2018-11-13 21:55:59 +01:00
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
2019-10-30 04:23:20 +01:00
|
|
|
Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE + "]")
|
2018-11-13 21:55:59 +01:00
|
|
|
return False
|
|
|
|
|
except OSError as e:
|
|
|
|
|
Log.debug(self, "{0}".format(e))
|
|
|
|
|
Log.error(self, "\nFailed to stop service : {0}"
|
|
|
|
|
.format(service_name))
|
|
|
|
|
|
|
|
|
|
def restart_service(self, service_name):
|
|
|
|
|
"""
|
|
|
|
|
Restart service
|
|
|
|
|
Similar to `service xyz restart`
|
|
|
|
|
"""
|
|
|
|
|
try:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if service_name in ['lsws']:
|
|
|
|
|
Log.wait(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
sub = subprocess.Popen(
|
|
|
|
|
'/usr/local/lsws/bin/openlitespeed -t',
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE, shell=True)
|
2019-08-26 18:05:26 +02:00
|
|
|
output, error_output = sub.communicate()
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if sub.returncode == 0:
|
|
|
|
|
Log.valide(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
Log.wait(self, "Restarting OpenLiteSpeed")
|
|
|
|
|
service_cmd = ('/usr/local/lsws/bin/lswsctrl restart')
|
2019-08-27 10:20:25 +02:00
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
2019-08-27 12:32:48 +02:00
|
|
|
if retcode[0] == 0:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.valide(self, "Restarting OpenLiteSpeed")
|
2019-08-27 12:32:48 +02:00
|
|
|
return True
|
2019-08-27 10:20:25 +02:00
|
|
|
else:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.failed(self, "Testing OpenLiteSpeed configuration ")
|
2019-08-27 10:20:25 +02:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
else:
|
|
|
|
|
service_cmd = ('service {0} restart'.format(service_name))
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.wait(self, "Restarting {0:10}".format(
|
|
|
|
|
service_name))
|
2019-08-27 10:20:25 +02:00
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
|
|
|
|
if retcode[0] == 0:
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.valide(self, "Restarting {0:10}".format(
|
|
|
|
|
service_name))
|
2019-08-27 10:20:25 +02:00
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.failed(self, "Restarting {0:10}".format(
|
|
|
|
|
service_name))
|
2019-08-27 10:20:25 +02:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
except OSError as e:
|
|
|
|
|
Log.debug(self, "{0} {1}".format(e.errno, e.strerror))
|
|
|
|
|
Log.error(self, "\nFailed to restart service : {0}"
|
|
|
|
|
.format(service_name))
|
|
|
|
|
|
|
|
|
|
def reload_service(self, service_name):
|
|
|
|
|
"""
|
2019-08-27 13:40:43 +02:00
|
|
|
Reload service
|
|
|
|
|
Similar to `service xyz reload`
|
2018-11-13 21:55:59 +01:00
|
|
|
"""
|
|
|
|
|
try:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if service_name in ['lsws']:
|
|
|
|
|
Log.wait(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
sub = subprocess.Popen(
|
|
|
|
|
'/usr/local/lsws/bin/openlitespeed -t',
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
stderr=subprocess.PIPE, shell=True)
|
2019-08-26 18:05:26 +02:00
|
|
|
output, error_output = sub.communicate()
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if sub.returncode == 0:
|
|
|
|
|
Log.valide(self, "Testing OpenLiteSpeed configuration ")
|
|
|
|
|
Log.wait(self, "Reloading OpenLiteSpeed")
|
|
|
|
|
service_cmd = ('/usr/local/lsws/bin/lswsctrl restart')
|
2019-08-27 10:20:25 +02:00
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
2019-08-27 12:32:48 +02:00
|
|
|
if retcode[0] == 0:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.valide(self, "Reloading OpenLiteSpeed")
|
2019-08-27 12:32:48 +02:00
|
|
|
return True
|
2019-12-03 19:48:18 +01:00
|
|
|
else:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
Log.failed(self, "Testing OpenLiteSpeed configuration ")
|
2019-12-03 19:48:18 +01:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
else:
|
|
|
|
|
service_cmd = ('service {0} reload'.format(service_name))
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.wait(self, "Reloading {0:10}".format(
|
|
|
|
|
service_name))
|
2019-08-27 10:20:25 +02:00
|
|
|
retcode = subprocess.getstatusoutput(service_cmd)
|
|
|
|
|
if retcode[0] == 0:
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.valide(self, "Reloading {0:10}".format(
|
|
|
|
|
service_name))
|
2019-10-03 16:57:19 +02:00
|
|
|
return True
|
2019-08-27 10:20:25 +02:00
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
2019-09-04 19:25:09 +02:00
|
|
|
Log.failed(self, "Reloading {0:10}".format(
|
|
|
|
|
service_name))
|
2019-08-27 10:20:25 +02:00
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
except OSError as e:
|
|
|
|
|
Log.debug(self, "{0}".format(e))
|
|
|
|
|
Log.error(self, "\nFailed to reload service {0}"
|
|
|
|
|
.format(service_name))
|
|
|
|
|
|
|
|
|
|
def get_service_status(self, service_name):
|
|
|
|
|
|
|
|
|
|
try:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
if service_name in ['lsws']:
|
|
|
|
|
retcode = subprocess.getstatusoutput(
|
|
|
|
|
'/usr/local/lsws/bin/lswsctrl status')
|
2018-11-13 21:55:59 +01:00
|
|
|
if retcode[0] == 0:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
|
|
|
|
return False
|
|
|
|
|
else:
|
feat: convert WordOps from Nginx to OpenLiteSpeed + LSPHP + LSCache
Complete conversion of the WordOps stack from Nginx + PHP-FPM to
OpenLiteSpeed + LSPHP + LSCache. This is a full rewrite across all 7
phases of the codebase:
- Foundation: OLS paths, variables, services, removed pynginxconfig dep
- Templates: 11 new OLS mustache templates, removed nginx-specific ones
- Stack: stack_pref, stack, stack_services, stack_upgrade, stack_migrate
- Site: site_functions, site, site_create, site_update
- Plugins: debug, info, log, clean rewritten for OLS
- SSL/ACME: acme.sh deploy uses lswsctrl, OLS vhssl blocks
- Other: secure, backup, clone, install script
Additional features:
- Debian 13 (trixie) support
- PHP 8.5 support
- WP Fort Knox mu-plugin integration (wo secure --lockdown/--unlock)
- --nginx CLI flag preserved for backward compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:55:16 +01:00
|
|
|
is_exist = subprocess.getstatusoutput('command -v {0}'
|
|
|
|
|
.format(service_name))
|
|
|
|
|
if is_exist[0] == 0:
|
|
|
|
|
retcode = subprocess.getstatusoutput('service {0} status'
|
|
|
|
|
.format(service_name))
|
|
|
|
|
if retcode[0] == 0:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
Log.debug(self, "{0}".format(retcode[1]))
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
return False
|
2018-11-13 21:55:59 +01:00
|
|
|
except OSError as e:
|
|
|
|
|
Log.debug(self, "{0}{1}".format(e.errno, e.strerror))
|
|
|
|
|
Log.error(self, "Unable to get services status of {0}"
|
|
|
|
|
.format(service_name))
|
|
|
|
|
return False
|