nodejitsu / aeternum Goto Github PK
View Code? Open in Web Editor NEWA process monitor in libuv
A process monitor in libuv
gcc -O2 -g -Wall -Ideps/libuv/include -framework CoreServices -o aeternum aeternum.c options.c deps/libuv/libuv.a
aeternum.c: In function ‘set_pidfile_path’:
aeternum.c:147: error: ‘WCHAR’ undeclared (first use in this function)
aeternum.c:147: error: (Each undeclared identifier is reported only once
aeternum.c:147: error: for each function it appears in.)
aeternum.c:147: error: expected ‘;’ before ‘homedir’
aeternum.c:148: warning: implicit declaration of function ‘FAILED’
aeternum.c:148: warning: implicit declaration of function ‘SHGetFolderPathW’
aeternum.c:148: error: ‘CSIDL_PROFILE’ undeclared (first use in this function)
aeternum.c:148: error: ‘path’ undeclared (first use in this function)
aeternum.c:148: error: expected ‘)’ before ‘{’ token
aeternum.c:172: error: expected expression before ‘}’ token
make: *** [aeternum] Error 1
Those appear to be some Windows constants. WTF.
aeternum
behaves properly if it receives one SIGUSR1 signal, but on the second attempt it kills the aeternum
process and leaves its child running.
cc @mmalecki
Would be nice if this worked.
A daemon should change to / before it runs, at least optionally. That way it does not block an unmount that might be needed.
Using SIGKILL gives the process no chance for cleanup. I propose sending SIGTERM initially, waiting a reasonable amount of time (possibly user defined and defaulting to x) for the process to end itself, and then finally send SIGKILL if necessary. I have some potentially longer-running operations (like sending emails) in my nodejitsu processes and my app will wait and exit cleanly when sent SIGTERM, but who knows what will be finished with a SIGKILL. Unfortunately I'm not great with C, or I'd send a PR.
In node.js...
var kill = function (child) {
var wait = 5 * 60 * 1000;
var timeout = setTimeout(child.kill.bind(child, 'SIGKILL'), wait);
child.on('close', clearTimeout.bind(null, timeout);
child.kill();
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.