Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Don't require /proc filesystem #10426
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
obastemur
Mar 21, 2015
Member
/proc is part of the linux kernel and many programs require the tools from that location to function properly. I would like to know more on that linux system without '/proc'
I think usage of /proc should not be necesary if the same info can be fetch by using ioctl(), specially since we support Windows and MacOS X that don't have that filesystem.
It's linux only.
|
It's linux only. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
piranna
Mar 21, 2015
/proc is part of the linux kernel and many programs require the tools from that location to function properly.
It's true /proc is part of Linux kernel, but it's not mandatory since it only expose its internal structures as a convenient filesystem API, the same can be (mostly) done by using ioctl(), only that in most cases by using /proc is simpler since you only need to read a file to fetch the data.
I would like to know more on that linux system without '/proc'
NodeOS currently is using /proc only to be able to get the memory usage stadistics (using Node.js) and to get the Linux kernel exec arguments (on /proc/cmdline), so it could be fully removed. This would allow to need less resources on the system and remove some security flaws (/proc by default show some sensitive data).
It's linux only.
Yes, and stolen from Plan9 :-) What I mean is that it's not available on Windows or MacOS X, so since some internal APIs are being used on that systems (and probable FreeBSD), something similar could be done on Linux to don't depend on /proc at all.
piranna
commented
Mar 21, 2015
It's true
NodeOS currently is using
Yes, and stolen from Plan9 :-) What I mean is that it's not available on Windows or MacOS X, so since some internal APIs are being used on that systems (and probable FreeBSD), something similar could be done on Linux to don't depend on |
dayuoba
commented
Mar 22, 2015
|
@piranna yes,i agree with you,for other using with linux,it should make less deps on /proc .what should the implemention be?and i think it is low priority for nodejs. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
piranna
Mar 22, 2015
what should the implemention be?
I'm honestly not a kernel developer, but mostly change all access to /proc files to their ioctl() corresponding call to fetch the same data. I don't believe there are too much of them, unluckily I have done a quick search on Node.js source code and didn't find them... I'll need to redo it later.
i think it is low priority for nodejs
Absolutelly.
piranna
commented
Mar 22, 2015
I'm honestly not a kernel developer, but mostly change all access to
Absolutelly. |
dayuoba
commented
Mar 22, 2015
|
@piranna that may be a funny work :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
piranna
commented
Mar 22, 2015
|
I'm happy you think so :-) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
saghul
Mar 23, 2015
Member
FWIW, this is not a Node issue, if anywhere, it belongs to libuv. Now, a quick glance shows that the following things depend on having /proc:
- /proc/self/exe: for exepath
- /proc/self/stat: for uv_resident_set_memory
- /proc/cpuinfo: for uv_cpu_info
- /proc/self/fd: for uv_fs_utime
I don't see this changing. But feel free to open an issue about it. Also be ready to write the code :-)
|
FWIW, this is not a Node issue, if anywhere, it belongs to libuv. Now, a quick glance shows that the following things depend on having /proc:
I don't see this changing. But feel free to open an issue about it. Also be ready to write the code :-) |
dayuoba
commented
Mar 24, 2015
|
@saghul cool |
misterdjules
added
process
v0.10
v0.12
labels
Mar 25, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
misterdjules
commented
Mar 25, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
piranna
commented
Mar 26, 2015
|
You are welcome @misterdjules. Also, good job @saghul! :-) |
piranna commentedMar 21, 2015
When using Node.js on a Linux system that don't have mounted
/procfilesystem, calling toprocess.memoryUsage()throw an ENOENT exception:I think usage of
/procshould not be necesary if the same info can be fetch by usingioctl(), specially since we support Windows and MacOS X that don't have that filesystem. This would be helpful to NodeOS.