From 21292677f61505c4b1615241d193a0b2bd1dc8af Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 14 Dec 2025 17:55:04 +0100 Subject: [PATCH] core/service: if RefreshOnReload= is explicitly enabled, allow reload even without exec/notify-reload This was originally brought up by @poettering. If the process loads stuff on demand and flushes them out after each use, or actively monitors file changes, they can be reloaded by merely refreshing the resources. --- src/core/service.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index 49dd82ebb8..255e86cfb5 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3297,7 +3297,10 @@ static bool service_can_reload(Unit *u) { Service *s = ASSERT_PTR(SERVICE(u)); return s->exec_command[SERVICE_EXEC_RELOAD] || - s->type == SERVICE_NOTIFY_RELOAD; + s->type == SERVICE_NOTIFY_RELOAD || + (s->refresh_on_reload_set && + (service_get_effective_reload_extensions(s) || + service_get_effective_reload_credentials(s))); } static unsigned service_exec_command_index(Unit *u, ServiceExecCommand id, const ExecCommand *current) {