Skip to content

Commit

Permalink
Updates for systemd, common helper service reload
Browse files Browse the repository at this point in the history
  • Loading branch information
sjones4 committed Sep 26, 2019
1 parent e0ac086 commit 29ad801
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions common/appscale/common/service_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,23 @@ def restart(name, background=False, start=True):
background=background))


def reload(name, background=False, start=True):
""" Reload the given service(s).
Args:
name: A str representing the name of the service(s) to reload.
background: True to start without blocking
start: True to start services if not already running (use False with name pattern)
"""
logger.info('Reloading service(s) {0}'.format(name))
command = 'try-reload-or-restart'
if start:
command = 'reload-or-restart'
__safe_systemctl_run(__build_command(command,
__name_match(name),
background=background))


def list(running=False):
""" List appscale service(s).
Expand Down

0 comments on commit 29ad801

Please sign in to comment.