From 4db42fdeb7b453bf2d176d69155bcdc4041ed7c5 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 6 Mar 2017 17:21:40 +0100 Subject: [PATCH 1/5] [fix] if a service don't have a 'status' entry, don't list it --- src/yunohost/service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(): From 949e4de20aa0cf84fa9fb4b6c292b93a382d17eb Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 6 Mar 2017 17:21:58 +0100 Subject: [PATCH 2/5] [fix] nsswitch and udisks2 aren't used anymore --- data/templates/yunohost/services.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data/templates/yunohost/services.yml b/data/templates/yunohost/services.yml index 97745890b..e17e53c22 100644 --- a/data/templates/yunohost/services.yml +++ b/data/templates/yunohost/services.yml @@ -50,10 +50,8 @@ yunohost-firewall: nslcd: status: service log: /var/log/syslog -nsswitch: - status: service -udisks2: - status: service +nsswitch: null +udisks2: null amavis: null postgrey: null spamassassin: null From 6d1c62d6191adb29b61b07d5a15546227aa934b4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 6 Mar 2017 17:22:42 +0100 Subject: [PATCH 3/5] [fix] we don't use bind9, add null entry to remove it from old services.yml --- data/templates/yunohost/services.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/data/templates/yunohost/services.yml b/data/templates/yunohost/services.yml index e17e53c22..5c25dcad8 100644 --- a/data/templates/yunohost/services.yml +++ b/data/templates/yunohost/services.yml @@ -51,6 +51,7 @@ nslcd: status: service log: /var/log/syslog nsswitch: null +bind9: null udisks2: null amavis: null postgrey: null From a18486df05f4898a5e9842229c73fbebe87b2d2a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 6 Mar 2017 20:24:36 +0100 Subject: [PATCH 4/5] [enh] add other services to remove --- data/templates/yunohost/services.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/templates/yunohost/services.yml b/data/templates/yunohost/services.yml index 5c25dcad8..bbe67972e 100644 --- a/data/templates/yunohost/services.yml +++ b/data/templates/yunohost/services.yml @@ -52,7 +52,10 @@ nslcd: log: /var/log/syslog nsswitch: null bind9: null +tahoe-lafs: null +memcached: null udisks2: null +udisk-glue: null amavis: null postgrey: null spamassassin: null From 50188ae265808139538ea90c6f2854f97d21a2b7 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 20 Mar 2017 01:49:27 +0100 Subject: [PATCH 5/5] [fix] only remove a service if it is setted to null --- data/hooks/conf_regen/01-yunohost | 2 +- data/templates/yunohost/services.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 bbe67972e..514cf5258 100644 --- a/data/templates/yunohost/services.yml +++ b/data/templates/yunohost/services.yml @@ -50,7 +50,7 @@ yunohost-firewall: nslcd: status: service log: /var/log/syslog -nsswitch: null +nsswitch: {} bind9: null tahoe-lafs: null memcached: null