Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 27 Aug 2014 21:59:55 +0100
From: Laurent Bercot <ska-dietlibc@...rnet.org>
To: musl@...ts.openwall.com
Subject: Re: static build and dlopen

> I tried to do it that way, but didn't worked. Seems on Linux when you
> are using a dynamically linked executable this is not run directly,
> but instead it is exec internally /lib/ld-linux.so.2, that's a program
> that load and link your executable and it's dynamic libraries and
> later exec it, so it takes the PID 1 and when it finish and give
> control to your dynamically linked executable (Node.js in this case),
> then since PID 1 has exited, the kernel has a kernel panic.

  No, the dynamic linker will run your executable with the same PID.
What happened in your case was that for some reason either the
dynamic linker failed to load your executable, and exited, or
Node.js exited. In any case, the system didn't work as it was
intended to; I can assure you it's supposed to work.
  Remember that with musl, the dynamic linker is called
/lib/ld-musl-${ARCH}.so.1 instead of /lib/ld-linux.so.2 so you might
want to check your setup again.

  That said, unless your Node.js really takes care of everything, it's
a good idea to not run it as PID 1, if only to make your filesystem
read-only at shutdown time.


> I've done a dumb /init program that just exec the dynamically linked
> Node.js with the real /init in Javascript and it worked. Ugly hack,
> but at least it does its job :-)

  By doing this, you are effectively using Node.js as process 1, since
it is your Javascript interpreter. So there is no reason you cannot
run it directly without your hack.

  I'm still concerned about Node.js' ability to shutdown your machine
properly though.

-- 
  Laurent

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.