Coder Social home page Coder Social logo

Comments (3)

saleyn avatar saleyn commented on July 17, 2024

I tried the following test, which seems to work correctly.
If you find a bug - patches are welcome.

$ sleep 2000
$ ps aux | grep sleep                                                                                                                                
serge    13085  0.0  0.0   5800   724 pts/3    S+   17:14   0:00 sleep 2000
6> exec:manage(13085, [link]).
{ok,<0.45.0>,13085}
7> 1 = 2.
** exception error: no match of right hand side value 2
# At this point the shell running "sleep 2000" gets terminated

from erlexec.

gatesn avatar gatesn commented on July 17, 2024

Correct me if this is insane and incorrect, but I'm trying to use run_link in a supervisor child spec, e.g.

{child_id, {exec, run_link, [Cmd, [exec args...]]}, permanent, 5000, worker, [exec]}

When the supervisor is shutdown, firstly I'd expect the linked process to be killed nicely (i.e. according to kill_group, kill command etc) and then I'd want it to exit with reason shutdown. So the supervisor doesn't complain about a shutdown error. Perhaps it's worth catching the normal/shutdown case separately from the parent exiting badly?

from erlexec.

saleyn avatar saleyn commented on July 17, 2024

This is not going to work for several reasons, but primarily because a supervisor expects a return from the child process being {ok, Pid}, and exec returns {ok, Pid, OsPid}. Aside from that a spawned child needs to adhere to OTP principles (e.g. processing system messages, which is handled under the hood by gen_* behaviors).

from erlexec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.