diff --git a/action_map.yml b/action_map.yml index 25b14784..6666c8ca 100644 --- a/action_map.yml +++ b/action_map.yml @@ -353,6 +353,9 @@ app: full: --log help: Absolute path to log file to display -r: + full: --runlevel + help: Runlevel priority of the service + -R: full: --remove help: Remove service action: store_true diff --git a/yunohost_app.py b/yunohost_app.py index 3ae30bc3..167409a6 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -581,7 +581,7 @@ def app_setting(app, key, value=None, delete=False): yaml.safe_dump(app_settings, f, default_flow_style=False) -def app_service(service, status=None, log=None, remove=False): +def app_service(service, status=None, log=None, runlevel=None, remove=False): """ Add or remove a YunoHost monitored service @@ -589,6 +589,7 @@ def app_service(service, status=None, log=None, remove=False): service -- Service to add/remove status -- Custom status command log -- Absolute path to log file to display + runlevel -- Runlevel priority of the service remove -- Remove service """ @@ -612,6 +613,9 @@ def app_service(service, status=None, log=None, remove=False): if log is not None: services[service]['log'] = log + if runlevel is not None: + services[service]['runlevel'] = runlevel + with open(service_file, 'w') as f: yaml.safe_dump(services, f, default_flow_style=False)