Comments (9)
@milkotodorov sorry for not seeing this issue til now; do you have any suggestions for how the processes should be cleanly handled?
from bosh-gen.
Short of pulling the whole subtree of pids via some ps+grep hackery, I don't know of anyway to do this outside of C (or any language with ready access to both /proc
and the raw system calls behind the kill
/ killall
utilities).
Ideally, the root process would, upon receiving SIGTERM, turn around and kill its children, who would in turn kill their children, etc, etc.
from bosh-gen.
@drnic ideally killing the root process should kill it's children too.
Since we can find the children of a process we can iterate recursively and kill them all.
In this state all clild processes won't be terminated.
from bosh-gen.
@milkotodorov do you have some code that works for you in other places that you'd like to see in all bosh releases?
from bosh-gen.
@drnic I had an issue with a bash script which started a java app. So the PID that was recorded was the one of the script and killing this PID didn't kill the java process. So my solution was to record the java PID instead and kill it. But for a better solution I think something like a kill_pid_tree() function could be introduced.
from bosh-gen.
Typically that's why you should exec
from the bash script after storing the process ID, then the Java process is the old script process, with the correct PID.
from bosh-gen.
@milkotodorov were you able to test if using exec
works for you in this scenario?
from bosh-gen.
yes - it worked. Thanks
from bosh-gen.
Related to this topic: I am exploring the new https://github.com/cloudfoundry-incubator/bpm-release/ for wrapping job processes inside containers; it will mean we get rid of all our wrapper scripts.
WIP PR at #102
from bosh-gen.
Related Issues (20)
- bosh-gen new does not create bucket in another region; nor setup config/final.yml
- Pickup existing AWS credentials from ~/.aws/credentials
- package -f dir should assume files 'dir/**/*'
- 'job -d some-dep' is not putting 'some-dep' in spec file
- Extract Package fails when files are not in source location HOT 2
- can't install bosh-gen HOT 8
- bosh-gen not exist command HOT 1
- Done with #14 HOT 2
- AWS GovCloud Region
- bosh-gen dependencies need to be updated to include mime-types gem HOT 2
- Trying to install bosh-gen get missing fog-aws 0.1.1, can't gem install it. HOT 2
- [major] upgrade to bosh2 cli, links, cloud-config HOT 2
- extract-pkg to use `bosh2 add-blob`
- bosh2 config/private.yml schema changed
- create version branch for CI
- Generate CI pipeline to build and test HOT 1
- generate version branch
- package -f blob/blob.tgz didn't work as expected
- Add "package <name> -f path/to/blob-1.2.3.tgz -v 1.2.3"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bosh-gen.