From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6042 Path: news.gmane.org!not-for-mail From: "piranna@gmail.com" Newsgroups: gmane.linux.lib.musl.general Subject: Re: static build and dlopen Date: Tue, 2 Sep 2014 01:38:55 +0200 Message-ID: References: <20140827164309.GO12888@brightrain.aerifal.cx> <53FE27E6.60902@skarnet.org> <53FE46CB.1040609@skarnet.org> <20140827225429.Horde.T30hkC5iP0azg6vTH4R_8g1@ssl.eumx.net> <53FE68BF.3090205@skarnet.org> <9C22AC43-6E0E-4CEE-ACA6-9CE07B4DACC7@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1409614772 9550 80.91.229.3 (1 Sep 2014 23:39:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2014 23:39:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6049-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 02 01:39:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XObC3-0001ja-LX for gllmg-musl@plane.gmane.org; Tue, 02 Sep 2014 01:39:27 +0200 Original-Received: (qmail 32213 invoked by uid 550); 1 Sep 2014 23:39:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32205 invoked from network); 1 Sep 2014 23:39:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=V1Xr+4XxCWBu463wL8HjPifqilvrHctVpxuYknJ/zss=; b=Zd8H+GS9HlDqBygAIbGLLfYVBs9UTkzSG/fdTIcJXIfOeE2+o4ejFz75ifUNgvJF7S v6XlbD87aYe+a0YZaN9TxvtAkta5nFL9JAGUBV691rfYUOZVBxbGcGgzQcPgK4DnsDsQ z8UC7tMR4L3rZri753mJiSZPAnUqcMVKesO5Zfgz4r7Cb/21opA9ijgll2UcUj3YtDJW FEtJv4tytugKgyb1Nu5erOgVBUlYgJtrHAqeCMlgWSQoThbucn4Lw5viF1GRJLE45vMf lUoBBIgQc261UHyAdlUO3dc/O/ffTHvtl+u8ZH/hDTwJqeVBiV+E5vN4xNkJTy+bhPy4 7zfg== X-Received: by 10.194.71.11 with SMTP id q11mr863183wju.33.1409614755345; Mon, 01 Sep 2014 16:39:15 -0700 (PDT) In-Reply-To: <9C22AC43-6E0E-4CEE-ACA6-9CE07B4DACC7@gmail.com> Xref: news.gmane.org gmane.linux.lib.musl.general:6042 Archived-At: Sorry for the delay, I have been busy these days. First of all, you were right: It possible to use dynamically linked executables for PID 1, seems I was missing one of the libraries (probably /lib/ld-linux.so.2... :-/ ). Now a Node.js script is working as PID 1 and in fact, the /usr/bin/env she-bang is working too, that's amazing :-D Sorry for have been doing so dumb questions this days, it's the first time I'm digging so down on Operating System architecture and I've missed this point (other guys go to the beach on their holidays... :-P ). Now my changes are uploaded and QEmu is also able to mount a hard disk image and access to it, all of it from Node.js (with the help of some compiled Node.js modules, of course). Regarding to the kernel low-level access, the compiled modules are working just as bridges between C & Javascript. There are not so much of them, but you can mount filesystems (https://github.com/groundwater/node-src-mount), configure network interfaces (https://github.com/groundwater/node-src-sockios, https://github.com/groundwater/node-bin-ifconfig), ioctl (https://github.com/groundwater/node-src-ioctl)... Oh, and also shutdown the machine (https://github.com/groundwater/node-bin-shutdown, https://github.com/groundwater/node-src-reboot) ;-) Obviously at this moment is really pre-alpha, but seems stable and could be useful to gain some performance on Node.js machines since all the bloatware is removed, but the idea is to take advantage of Node.js features, capabilities and LXC containers (like Docker) to make isolation and the feeling of the developer that "all the machine is theirs" as added killer features :-) Obviously all of them must be run with setuid 0, but at this moment I only needed it only for mounting the filesystem, no more. Oh, and if you want harder drugs, you should take a look at http://runtimejs.org, where some developers works somewhat actively (like groundwater) on both projects: where NodeOS aims to create a Linux based operating system where all the user-space is build on top of Node.js, runtime.js aims to develop an OS kernel in pure Javascript on top of raw v8 isolates and get some extra performance by delegating memory protection to them so all process can run on ring 0 (no context-switchs) and message-based IPC by just exchanging a pointer. Innovative? yes. Crazy? maybe. Awesome? don't doubt it ;-) 2014-08-28 1:36 GMT+02:00 Brent Cook : > > On Aug 27, 2014, at 6:24 PM, Laurent Bercot wr= ote: > >>> Node.js spends a lot of time throwing uncaught exceptions; I suspect >>> transitioning to S5 will be less common than node just dying. >> >> Then it's all the more reason to *not* run it as process 1. >> If Node.js dies unexpectedly, you want to restart it automatically, >> or at least to reboot; you do not want a kernel panic and a >> maintenance call. >> >> >>> Perhaps this would be ok with a stateless netbooted ramdisk as a >>> root fs. >> >> Kernel + libc + Node + all the needed node modules, netbooted ? >> Now I know why the terminals at my train station are so slow. :P >> >> -- >> Laurent >> > > IIRC the pfsense ands m0n0wall firewalls run PHP as process 1, so I > guess something like this is not unheard of. But, they do run from a > ramdisk as well. --=20 "Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix." =E2=80=93 Linus Tordvals, creador del sistema operativo Linux