Skip to content

sysmgr doesn't reap children processes #1

@biqqthiqq

Description

@biqqthiqq

hey, so I've been running sysmgr for a while, I've noticed an issue where old runsyssv processes will not get reaped, and as these spawn pretty rapidly I end up hitting the process limit on my system and having to reboot.

  675 root      0:00 runsyssv /var/sysmgr/eudev
  676 root      0:00 runsyssv /var/sysmgr/dbus
  678 root      0:00 runsyssv /var/sysmgr/seatd
  910 root      0:00 runsyssv /var/sysmgr/dhcpcd
 3743 root      0:00 [runsyssv]
 3746 root      0:00 [runsyssv]
 3749 root      0:00 [runsyssv]
 3752 root      0:00 [runsyssv]
 3759 root      0:00 [runsyssv]
 3766 root      0:00 [runsyssv]
 ...

if we check these processes with pstree, it shows sysmgr as the parent process still, so init doesn't end up doing any reaping.

quick fix I found from 1 is adding a call signal SIGCHLD to sysmgr.c here,

	/* Go to the service directory and get all the service entries. */
	DIR *dir;
	struct dirent *ent;
        signal(SIGCHLD,SIG_IGN);
	while(1) {
		if ((dir = opendir(sysdir)) == NULL)

however not sure if this is the correct fix, I'm thinking it may be better add SIGCHLD to sv_signals, and add a condition to the term function to call wait if the signal is SIGCHLD, not too sure yet on how to gracefully implement though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions