diff --git a/data/hooks/conf_regen/01-yunohost b/data/hooks/conf_regen/01-yunohost index 96b62fe67..f8bef0614 100755 --- a/data/hooks/conf_regen/01-yunohost +++ b/data/hooks/conf_regen/01-yunohost @@ -65,7 +65,7 @@ with open('/etc/yunohost/services.yml') as f: updated = False for service, conf in new_services.items(): # remove service with empty conf - if not conf: + if conf is None: if service in services: print("removing '{0}' from services".format(service)) del services[service] diff --git a/data/templates/yunohost/services.yml b/data/templates/yunohost/services.yml index 97745890b..514cf5258 100644 --- a/data/templates/yunohost/services.yml +++ b/data/templates/yunohost/services.yml @@ -50,10 +50,12 @@ yunohost-firewall: nslcd: status: service log: /var/log/syslog -nsswitch: - status: service -udisks2: - status: service +nsswitch: {} +bind9: null +tahoe-lafs: null +memcached: null +udisks2: null +udisk-glue: null amavis: null postgrey: null spamassassin: null diff --git a/src/yunohost/service.py b/src/yunohost/service.py index c648a0e0e..e64c9cd89 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -201,11 +201,12 @@ def service_status(names=[]): m18n.n('service_unknown', service=name)) status = None - if 'status' not in services[name] or \ - services[name]['status'] == 'service': + if services[name].get('status') == 'service': status = 'service %s status' % name - else: + elif "status" in services[name]: status = str(services[name]['status']) + else: + continue runlevel = 5 if 'runlevel' in services[name].keys():