Open schmunk42 opened 6 years ago
forego execs the command now, so this issue can be closed, I think.
Additionally, there appears to be an issue with sending signals to the child process. (Related to #114?)
When I have the following Procfile
apache2: source /etc/apache2/envvars; apache2 -DNO_DETACH
cron: cron -f
I see the following
# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 02:49 ? 00:00:00 /bin/bash
root 17 0 0 02:49 ? 00:00:00 /bin/bash
root 226 1 0 02:59 ? 00:00:00 forego start -r -f /Procfile
root 240 226 0 02:59 ? 00:00:00 /bin/bash -c source "/.profile" 2>/dev/null; source /etc/apache2/envvars; apache2 -DNO_
root 242 226 0 02:59 ? 00:00:00 /bin/bash -c source "/.profile" 2>/dev/null; cron -f
root 243 240 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
root 244 242 0 02:59 ? 00:00:00 cron -f
docker 248 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 249 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 250 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 251 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 252 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
root 259 17 0 02:59 ? 00:00:00 ps -ef
If I send SIGINT
to forego
(by issuing Ctrl+C):
^C | ctrl-c detected
forego | sending SIGTERM to cron.1
forego | sending SIGTERM to apache2.1
I see the /bin/bash
processes exit (and cron
), but not apache2
:
# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 02:49 ? 00:00:00 /bin/bash
root 17 0 0 02:49 ? 00:00:00 /bin/bash
root 243 1 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 248 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 249 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 250 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 251 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
docker 252 243 0 02:59 ? 00:00:00 apache2 -DNO_DETACH
root 260 17 0 03:01 ? 00:00:00 ps -ef
While examining processes and thread on our Docker-hosts, I found:
Should be coming from https://github.com/ddollar/forego/blob/c6e54eeee78456219f9aa6dcf9d5ed65d671b37e/unix.go#L13-L22, I think.
Couldn't this be optimized, so we don't have those sleeping processes?
There are also the processes themselves: