this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix init process detection and container shutdown

+17 -1
+17 -1
src/startup/darling.c
··· 160 160 // TODO: when we have a working launchd, 161 161 // this is where we ask it to shut down nicely 162 162 163 + char path_buf[128]; 164 + char read_buf[128]; 165 + FILE* file; 166 + pid_t launchd_pid; 167 + snprintf(path_buf, sizeof(path_buf), "/proc/%d/task/%d/children", pidInit, pidInit); 168 + file = fopen(path_buf, "r"); 169 + if (!file || fscanf(file, "%d", &launchd_pid) != 1) { 170 + fprintf(stderr, "Failed to shutdown Darling container\n"); 171 + if (file) { 172 + fclose(file); 173 + } 174 + return 1; 175 + } 176 + fclose(file); 177 + 178 + kill(launchd_pid, SIGKILL); 163 179 kill(pidInit, SIGKILL); 164 180 return 0; 165 181 } ··· 1074 1090 } 1075 1091 fclose(fp); 1076 1092 1077 - if (strcmp(exeBuf, "launchd") != 0) 1093 + if (strcmp(exeBuf, "darlingserver") != 0) 1078 1094 { 1079 1095 unlink(pidPath); 1080 1096 return 0;