Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(jans-linux-setup): revert admin-ui restart #10744

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions jans-linux-setup/jans_setup/static/scripts/jans
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,11 @@ from collections import OrderedDict

JANS_JETTY_DIR = '/opt/jans/jetty'
JANS_SERVICES = os.listdir(JANS_JETTY_DIR)
ADMIN_UI_INSTALLED = os.path.exists(
os.path.join(
JANS_JETTY_DIR,
'jans-config-api/custom/libs/gluu-flex-admin-ui-plugin.jar'
)
)

if ADMIN_UI_INSTALLED and 'restart' in sys.argv:
JANS_SERVICES.append('admin-ui')

if len(sys.argv) > 1 and sys.argv[1] == 'cli':
cli_args = sys.argv[2:]
sys.argv = sys.argv[:2]


parser = argparse.ArgumentParser(description="A top-level wrapper script for Janssen")
subparsers = parser.add_subparsers(dest='command')
subparsers.add_parser('version', help="shows version of currently installed Janssen Server")
Expand Down Expand Up @@ -77,23 +67,6 @@ def logs():
print(f" {os.path.join(log_dir, log)}")

def service_command(todo):
if argsp.service == 'admin-ui':
if todo != 'restart':
print("\033[93mOnly \033[1mrestart\033[0m \033[93mcommand is available for admin-ui\033[0m")
else:
httpd_name = None
for sname in ('httpd', 'apache2'):
if os.popen(f'systemctl show --no-pager {sname} | grep LoadState=loaded').read().strip():
httpd_name = sname
break
if not httpd_name:
print("\033[93mUnable to determine httpd server name\033[0m")
return
for sub_service in ('jans-config-api', httpd_name):
argsp.service = sub_service
service_command('restart')
return

services = [argsp.service] if argsp.service else JANS_SERVICES
if todo == 'stop':
services = reversed(services)
Expand Down
Loading