@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

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

Make bin/aphlict behave slightly better when forking

Summary:
Due to how file descriptors get inherited when a process forks and the way
our script to start/restart stuff works, having bin/aphlict not close
STDOUT caused our script to hang. This diff provides a solution; however,
something like https://secure.phabricator.com/diffusion/PHU/browse/master/src/daemon/PhutilDaemonOverseer.php;b45eea975f6d9afc$127-129
may be better or more robust.

Test Plan:
Run our script that calls bin/aphlict in passthru() and see that it no
longer hangs.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4240

+7
+7
support/aphlict/server/aphlict_launcher.php
··· 89 89 } else if ($pid) { 90 90 exit(0); 91 91 } 92 + // When we fork, the child process will inherit its parent's set of open 93 + // file descriptors. If the parent process of bin/aphlict is waiting for 94 + // bin/aphlict's file descriptors to close, it will be stuck waiting on 95 + // the daemonized process. (This happens if e.g. bin/aphlict is started 96 + // in another script using passthru().) 97 + fclose(STDOUT); 98 + fclose(STDERR); 92 99 } 93 100 94 101