- Starting and stopping processes
- Controlling the Daemon
- Managing clusters
- Installing and running apps
- Remote access and monitoring (e.g. guv-web)
- Web interface
- Web interface - configuration
- Web interface - user management
- Programmatic access
- Programmatic access - local
- Programmatic access - remote
- Programmatic access - events
guv start [options] <script>
Start a new process.
-h, --help output usage information
-u, --user <user> The user to start a process as
-g, --group <group> The group to start a process as
-i, --instances <instances> How many instances of the process to start (e.g. cluster mode)
-n, --name <name> What name to give the process
-a, --argv <argv> A space separated list of arguments to pass to a process
-e, --execArgv <execArgv> A space separated list of arguments to pass to the node executable
-d, --debug Pause the process at the start of execution and wait for a debugger to be attached
-v, --verbose Prints detailed internal logging output
To start http-server.js
as a cluster with two workers, running as alex:staff
and with two command line arguments -a foo
and -b bar
$ guv start -u alex -g staff -i 2 -argv '-a foo -b bar' http-server.js
Restart a running process
guv restart <pid>
Stop a running process.
guv stop <pid>
guv list
Display a list of processes guvnor has started.
Send an event to a process
guv send <pid> <event> [args...]
In my script
process.on('my:custom:event', function(arg1, arg2) {
console.info(arg1 + arg2)
})
$ guv send 39823 my:custom:event 1 2
// process 39823 then prints '3' to the logs
Make a process dump a heap snapshot for analysis in Chrome's debug tools. The file will appear at process.cwd
guv heapdump <pid>
Force a process to do garbage collection
guv gc <pid>
Send a signal to a process (n.b. unless you have a listener for that signal, your process will most likely exit)
guv signal <pid> <signal>
$ guv signal 3984 SIGINT
Writes a string to the stdin of your process
guv write <pid> <string>
$ guv write 3984 'hello world'