From a067bf74a3a2e20b3d8152c1aa7ab49a4ff21afd Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Tue, 19 Nov 2024 12:58:49 +0100 Subject: [PATCH 1/3] Fix (event): node check to use 'node_id' instead of 'node' --- imageroot/events/user-domain-changed/20configure_ldap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/events/user-domain-changed/20configure_ldap b/imageroot/events/user-domain-changed/20configure_ldap index 48a7e0f..75b38e1 100755 --- a/imageroot/events/user-domain-changed/20configure_ldap +++ b/imageroot/events/user-domain-changed/20configure_ldap @@ -15,7 +15,7 @@ event = json.load(sys.stdin) if event.get('domain') != os.getenv('EJABBERD_LDAP_DOMAIN'): exit(0) -if 'node' in event and str(event['node']) != os.getenv('NODE_ID'): +if 'node_id' in event and str(event['node_id']) != os.getenv('NODE_ID'): exit(0) # ignore event if the source is not in our node agent.run_helper('systemctl', '--user', '-T', 'try-reload-or-restart', 'ejabberd.service').check_returncode() From cc81883f164d4cc2621fd21836cf4c123000ef88 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Tue, 19 Nov 2024 15:11:26 +0100 Subject: [PATCH 2/3] Fix (event): update ejabberd service command to use 'try-restart' instead of 'try-reload-or-restart' --- imageroot/events/user-domain-changed/20configure_ldap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageroot/events/user-domain-changed/20configure_ldap b/imageroot/events/user-domain-changed/20configure_ldap index 75b38e1..2652804 100755 --- a/imageroot/events/user-domain-changed/20configure_ldap +++ b/imageroot/events/user-domain-changed/20configure_ldap @@ -18,4 +18,4 @@ if event.get('domain') != os.getenv('EJABBERD_LDAP_DOMAIN'): if 'node_id' in event and str(event['node_id']) != os.getenv('NODE_ID'): exit(0) # ignore event if the source is not in our node -agent.run_helper('systemctl', '--user', '-T', 'try-reload-or-restart', 'ejabberd.service').check_returncode() +agent.run_helper('systemctl', '--user', '-T', 'try-restart', 'ejabberd.service').check_returncode() From cb7f2a5cd00e41d70b15fd2e43127866806ddb4e Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Fri, 22 Nov 2024 12:08:39 +0100 Subject: [PATCH 3/3] Fix (event): remove node_id check from LDAP domain change event --- imageroot/events/user-domain-changed/20configure_ldap | 3 --- 1 file changed, 3 deletions(-) diff --git a/imageroot/events/user-domain-changed/20configure_ldap b/imageroot/events/user-domain-changed/20configure_ldap index 2652804..7a4d68a 100755 --- a/imageroot/events/user-domain-changed/20configure_ldap +++ b/imageroot/events/user-domain-changed/20configure_ldap @@ -15,7 +15,4 @@ event = json.load(sys.stdin) if event.get('domain') != os.getenv('EJABBERD_LDAP_DOMAIN'): exit(0) -if 'node_id' in event and str(event['node_id']) != os.getenv('NODE_ID'): - exit(0) # ignore event if the source is not in our node - agent.run_helper('systemctl', '--user', '-T', 'try-restart', 'ejabberd.service').check_returncode()