Skip to content

Forego adds sleeping bash process for every application (read from .profile) #106

@schmunk42

Description

@schmunk42

While examining processes and thread on our Docker-hosts, I found:

root     32287 32216  0 Sep07 ?        00:01:01 forego start -r -f /root/Procfile
root     32293 32287  0 Sep07 ?        00:00:00 /bin/bash -c source "/root/.profile" 2>/dev/null; nginx -g 'daemon off;'
root     32297 32287  0 Sep07 ?        00:00:00 /bin/bash -c source "/root/.profile" 2>/dev/null; docker-run.sh
root     32300 32287  0 Sep07 ?        00:00:00 /bin/bash -c source "/root/.profile" 2>/dev/null; crond -f
root     32303 32287  0 Sep07 ?        00:00:00 /bin/bash -c source „/root/.profile“ 2>/dev/null; yii resque/work internal

Should be coming from

forego/unix.go

Lines 13 to 22 in c6e54ee

func ShellInvocationCommand(interactive bool, root, command string) []string {
shellArgument := "-c"
if interactive {
shellArgument = "-ic"
}
profile := filepath.Join(root, ".profile")
shellCommand := fmt.Sprintf("source \"%s\" 2>/dev/null; %s", profile, command)
return []string{"bash", shellArgument, shellCommand}
}
, I think.

Couldn't this be optimized, so we don't have those sleeping processes?

There are also the processes themselves:

root     32299 32293  0 Sep07 ?        00:00:00 nginx: master process nginx -g daemon off;
root     32305 32300  0 Sep07 ?        00:00:53 crond -f
root     32307 32303  0 Sep07 ?        00:02:39 php /app/yii resque/work internal
root     32304 32297  0 Sep07 ?        00:00:00 /bin/bash /usr/local/bin/docker-run.sh

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