Comments (6)
Oh I found the line:
https://github.com/saleyn/erlexec/blob/master/c_src/exec.cpp#L982
If there is some reason why u write this?
from erlexec.
When a command gets run by exec
with an alternative kill command: exec:run(Cmd, [{kill, KillCmd}])
, the KillCmd
is used to kill the spawned OS pid instead of using SIGTERM.
The transient_pids are the list of KillCmd
processes that have been executed/forked and are still active. At exit of the port process the line you are referring to relates to the erlexec
port trying to kill the active "kill commands". On that line it->first
should not be equal to 1
, and if it is, that's a bug, so if you could troubleshoot it to find out when/why it gets assigned, that would be helpful.
from erlexec.
I directed you to the wrong line, sorry. Here is my problem:
I start new OS process in my erlang app, for example mysql. And when I send "kill -9 pid_of_erlang_app" mysql goes down.
Another symptoms:
- when I create OS process through erlexec it dies with erlang app
- when I manage OS process through erlexec it does NOT die with erlang app
So I think there is problem with unlinking OS process with erlang app on creation.
from erlexec.
This is by design - the OS processes forked by erlexec are linked to it in a sense that when erlexec is signaled to be terminated (by loosing the connection to the Erlang VM that started it), it kills all forked children.
It would be possible to mark a child with "don't kill on exit" flag, and avoid killing it, though it is a new feature that would need to be implemented. However I see very little point in this - if you don't care about the forked process to be killed on exit, then why would you want to spawn it by erlexec to begin with instead of running it externally as a service?
from erlexec.
I'm writing some kind of Monit with elixir lang and this feature one of the main: monitoring of processes should not die with spawned processes, it should die alone and after resurrection manage spawned before processes. Your library is the only good way to execute and control OS processes from Erlang/Elixir, so if you skip this feature I will switch to another language. Please let me know about your decision.
from erlexec.
Why would you want to exit the Erlang VM? In your design you can have an Erlang agent node running as a daemon, that would control other pids (through erlexec), just like serviced or initd do. Your Monit interface would connect to active Erlang agent, and be able to start/control other OS pids. If you are concerned that an Erlang node could die - in a tested system that is a highly unlikely event, and if it does then it'll restart all dependencies.
In any event, you are welcome to submit a patch to handle this. I suppose you can pass a 'daemon'
option to exec:run/2
, which would fork a child, and "manage" it instead of "own"ing it.
from erlexec.
Related Issues (20)
- Disable erl_interface for Erlang 23 HOT 1
- :env option in 1.18.8 HOT 2
- Establishing/Supervising Communications With a Long-Running, Data Streaming Python Process HOT 3
- New release? Resolve port hanging HOT 2
- Exit codes appear to be x256 too large HOT 1
- erlexec on linux slows down when nofile limit is a large value HOT 2
- Mac OS error: use of undeclared identifier 'pipe2' HOT 2
- Could not compile dependency :erlexec HOT 15
- I am running into issues with elixir release HOT 3
- When native stdin process buffer is full, erlexec does not retry HOT 11
- PTY dynamic option test failing HOT 6
- Does 2.0.0 contain a breaking change? HOT 1
- Compile failure on OSX M1 mac HOT 4
- Passing command arguments as list HOT 1
- USE_POLL is not set HOT 1
- Failed build on FreeBSD HOT 9
- Compile fails on arm HOT 4
- Any command terminates with exit status 132 HOT 8
- Issue on ARM Mac HOT 9
- Erlexec compile fails on FreeBSD 14 HOT 1
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 erlexec.