Skip to content

Commit

Permalink
service: schedule cleanup of PID hashmaps when we now longer have mai…
Browse files Browse the repository at this point in the history
…n_pid and we are in container

RHEL-only

Resolves: RHEL-5863
  • Loading branch information
msekletar authored and github-actions[bot] committed Feb 12, 2024
1 parent 8ac0c00 commit 8bf7a6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "virt.h"
#include "unit-name.h"
#include "unit.h"
#include "utf8.h"
Expand Down Expand Up @@ -3535,7 +3536,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
* detect when the cgroup becomes empty. Note that the control process is always
* our child so it's pointless to watch all other processes. */
if (!control_pid_good(s))
if (!s->main_pid_known || s->main_pid_alien)
if (!s->main_pid_known || s->main_pid_alien || (s->main_pid == 0 && detect_container() > 0))
(void) unit_enqueue_rewatch_pids(u);
}

Expand Down

0 comments on commit 8bf7a6f

Please sign in to comment.