Sunday, 15 August 2010

bash - Node.js: Watching a process in Linux for state changes -



bash - Node.js: Watching a process in Linux for state changes -

are there files in linux filesystem watch changes on monitor process' status? in other words, there file can watched fast process state alter detection?

i assume it'd in /proc directory, , i'd utilize use node.js , filesystem function fs.watch() instant changes on process' status. (such running, frozen, nonexistent, etc)

is there file can find process' status in?

the current process state can found in /proc/$pid/stat. 3rd field man proc:

state %c 1 character string "rsdztw" r running, s sleeping in interrupt‐ ible wait, d waiting in uninterruptible disk sleep, z zombie, t traced or stopped (on signal), , w paging.

whether can utilize file scheme watch functions on matter, /proc files aren't real files, rather handles generate info on demand.

linux bash node.js process

No comments:

Post a Comment