mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
core/socket: don't consider service active when in SERVICE_AUTO_RESTART_QUEUED
Follow-up for 09d04ad325
Fixes #28856
This commit is contained in:
parent
f9e653cfb7
commit
c068650fcf
@ -2487,12 +2487,16 @@ static int socket_start(Unit *u) {
|
||||
service = SERVICE(UNIT_DEREF(s->service));
|
||||
|
||||
if (UNIT(service)->load_state != UNIT_LOADED)
|
||||
return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOENT), "Socket service %s not loaded, refusing.", UNIT(service)->id);
|
||||
return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOENT),
|
||||
"Socket service %s not loaded, refusing.", UNIT(service)->id);
|
||||
|
||||
/* If the service is already active we cannot start the
|
||||
* socket */
|
||||
if (!IN_SET(service->state, SERVICE_DEAD, SERVICE_FAILED, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_FAILED_BEFORE_AUTO_RESTART, SERVICE_AUTO_RESTART))
|
||||
return log_unit_error_errno(u, SYNTHETIC_ERRNO(EBUSY), "Socket service %s already active, refusing.", UNIT(service)->id);
|
||||
if (!IN_SET(service->state,
|
||||
SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART,
|
||||
SERVICE_AUTO_RESTART, SERVICE_AUTO_RESTART_QUEUED))
|
||||
return log_unit_error_errno(u, SYNTHETIC_ERRNO(EBUSY),
|
||||
"Socket service %s already active, refusing.", UNIT(service)->id);
|
||||
}
|
||||
|
||||
assert(IN_SET(s->state, SOCKET_DEAD, SOCKET_FAILED));
|
||||
@ -3356,7 +3360,7 @@ static void socket_trigger_notify(Unit *u, Unit *other) {
|
||||
if (IN_SET(SERVICE(other)->state,
|
||||
SERVICE_DEAD, SERVICE_DEAD_BEFORE_AUTO_RESTART, SERVICE_FAILED, SERVICE_FAILED_BEFORE_AUTO_RESTART,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
|
||||
SERVICE_AUTO_RESTART))
|
||||
SERVICE_AUTO_RESTART, SERVICE_AUTO_RESTART_QUEUED))
|
||||
socket_enter_listening(s);
|
||||
|
||||
if (SERVICE(other)->state == SERVICE_RUNNING)
|
||||
|
Loading…
Reference in New Issue
Block a user