Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

multiple processes: starting / stopping? #160

Open
cjerdonek opened this issue Dec 24, 2015 · 3 comments
Open

multiple processes: starting / stopping? #160

cjerdonek opened this issue Dec 24, 2015 · 3 comments

Comments

@cjerdonek
Copy link

I noticed that when running docker-osx-dev sync:

$ docker-osx-dev sync -c <path1> -s <path2> -s <path3>

it starts two additional child processes with the same command:

$ ps xao pid,ppid,command | grep '[d]ocker-osx-dev sync'
69989 50446 /bin/bash /usr/local/bin/docker-osx-dev sync -c <path1> -s <path2> -s <path3>
70145 69989 /bin/bash /usr/local/bin/docker-osx-dev sync -c <path1> -s <path2> -s <path3>
70146 69989 /bin/bash /usr/local/bin/docker-osx-dev sync -c <path1> -s <path2> -s <path3>

Is it supposed to be doing this?

Also, when I send a SIGINT, SIGTERM, or SIGKILL to the parent process from a different process (e.g. from a different terminal window), docker-osx-dev doesn't terminate its two children:

$ kill -15 69989
$ ps xao pid,ppid,command | grep '[d]ocker-osx-dev sync'
70145     1 /bin/bash /usr/local/bin/docker-osx-dev sync -c <path1> -s <path2> -s <path3>
70146     1 /bin/bash /usr/local/bin/docker-osx-dev sync -c <path1> -s <path2> -s <path3>
@brikis98
Copy link
Owner

docker-osx-dev fires up fswatch. It also runs boot2docker for you if it isn't already started. Not sure if those are the two processes you're seeing... If you CTRL+C docker-osx-dev itself (instead of the kill command), do those other two go away?

@cjerdonek
Copy link
Author

I meant to add that fswatch is also a descendant / grandchild process (a child of one of the two additional child processes), so I'm seeing four in all. Yes, control-c from the same shell kills them all. If it is running as a background process or for automation purposes, it would be better if terminating the parent via a signal terminates its descendants and not just the parent. Here is a page with information on how to do this in bash. I noticed I had a half-dozen orphaned fswatch processes from this.

@brikis98
Copy link
Owner

Agreed, docker-osx-dev should do a better job of managing its child processes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants