Can't execute a command using child_process.exec or child_process.spawn #32

Closed
julianduque opened this Issue Sep 11, 2013 · 10 comments

Comments

Projects
None yet
4 participants
[09/11 15:52:37 GMT-0500][err] { [Error: Command failed: ld.so.1: ksh93: fatal: /opt/local/lib/node_modules/forza/libinterposed.so: wrong ELF class: ELFCLASS64
[09/11 15:52:37 GMT-0500][err] ] killed: false, code: null, signal: 'SIGKILL' } 'failed'
Contributor

mmalecki commented Sep 25, 2013

Okay, so the only possible solution here is to have users remove LD_PRELOAD from environment of spawned process.

mmalecki closed this Sep 25, 2013

Contributor

mmalecki commented Sep 25, 2013

Oh, now that I think about it, we could just use x32 bits all on all our servers. I'm not sure which one is better here - one is more user-friendly but would take some time to migrate.

User friendly + natural way = better. I think the LD_PRELOAD solution is tricky

julianduque reopened this Sep 26, 2013

bmeck commented Sep 26, 2013

Just to clarify, when I was thinking of similar things originally
LD_PRELOAD would be removed right as hooks are set up. Are the intents here
for all the hooks to apply to child processes as well as the first process
forza spawns?

On Wed, Sep 25, 2013 at 10:21 PM, Julian Duque notifications@github.comwrote:

User friendly + natural way = better. I think the LD_PRELOAD solution is
tricky


Reply to this email directly or view it on GitHubhttps://github.com/opsmezzo/forza/issues/32#issuecomment-25141349
.

Owner

indexzero commented Sep 26, 2013

@bmeck Is there a way to hook do this directly in C?

Owner

indexzero commented Sep 26, 2013

@mmalecki Do we even need the LD_PRELOAD set in the top-level node process? In other words, couldn't forza just delete the LD_PRELOAD from the envvars passed to the process it spawns?

Bradley Meck
also, do you want to keep that on the root process even?
yea you could just add that and it will be for the parentmost proc
would also let you invoke child procs and readd it if you want
but it would need to explicitly be set for each proc which is probably for the best
Contributor

mmalecki commented Sep 26, 2013

Charlie,

the chain right now is: aeternum -> forza -> node. forza has to set LD_PRELOAD on node in order to find what port node listens on.

I'm honestly not sure how to go about removing it from the node process after spawning. Is there a way to do it on our side @bmeck?

bmeck commented Sep 26, 2013

Yes, during the libinterposed step there are several ways to fire a C level
function during library load:

http://stackoverflow.com/questions/9759880/automatically-executed-functions-when-loading-shared-libraries
http://docs.oracle.com/cd/E19205-01/819-5267/bkbki/index.html

This can be fired on the node process as interposed is being setup. See the
link above to the original interposed for a list of things you should look
up / do.

On Thu, Sep 26, 2013 at 4:22 AM, Maciej Małecki notifications@github.comwrote:

Charlie,

the chain right now is: aeternum -> forza -> node. forza has to set
LD_PRELOAD on node in order to find what port node listens on.

I'm honestly not sure how to go about removing it from the node process
after spawning. Is there a way to do it on our side @bmeckhttps://github.com/bmeck
?


Reply to this email directly or view it on GitHubhttps://github.com/opsmezzo/forza/issues/32#issuecomment-25153984
.

mmalecki closed this in 002572c Sep 27, 2013

Contributor

mmalecki commented Sep 27, 2013

^ should fix it. Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment