Quickly reboot Linux from node.js without fork()ing /sbin/shutdown or going thru initscripts
Reboot Linux kernel immediately from node without calling
/sbin/shutdown or going thru initscripts.
I'm running a cluster of Linux servers which boot readonly and perform a memory-intensive computations. node-reboot is a part of a watchdog application, which in case of emergencies much reboot the server immediately without
fork()ing another process or going thru upstart/initscripts.
sync() and then reboot:
The function should never return. If it does, it means node has insufficient permissions.
If you are to run node process under non-superuser, be sure to give node permissions to reboot the system:
sudo setcap CAP_SYS_BOOT=+ep /usr/local/bin/node
man capabilities for details.
npm install reboot
npm install .
See LICENSE file. Basically, it's a kind of "do-whatever-you-want-for-free" license.