tableflip / guvnor Goto Github PK
View Code? Open in Web Editor NEWA node process manager that isn't spanners all the way down
License: MIT License
A node process manager that isn't spanners all the way down
License: MIT License
The web interface needs an equivalent of the cli setref [options] <appName> <ref>
command.
Specifically:
sudo bs remoteconfig
warn: You do not appear to have sufficient permissions
sudo bs useradd alex
warn: You do not appear to have sufficient permissions
sudo bs kill
warn: You do not appear to have sufficient permissions
boss daemon is running as root, my user is in the boss group.
Any advice?
When you take a heap snapshot of a process running under a dockerised guvnor, there's no easy way to get the actual dump file.
The web interface needs a page that lets you download heap snapshots.
$ bs-web
Uncaught error Error: No component with name mdns has been registered
at Container._getDependency (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:224:24)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:104:32)
at Array.forEach (native)
at Dependency._testForCircularDependencies (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:99:16)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:17:10)
at processImmediate [as _immediateCallback] (timers.js:354:15)
/usr/local/lib/node_modules/process-boss/lib/web/BossWeb.js:12
throw error
^
Error: No component with name mdns has been registered
at Container._getDependency (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:224:24)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:104:32)
at Array.forEach (native)
at Dependency._testForCircularDependencies (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:99:16)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Dependency.js:17:10)
at processImmediate [as _immediateCallback] (timers.js:354:15)
$ boss --version
2.5.2
$ node -v
v0.10.36
sh-3.2# NODE_ENV=production bs start /Users/alan/Code/project/keystone.js -u alan -g admin --name project -v
debug: Loaded config from 0=/usr/local/lib/node_modules/process-boss/bossrc
debug: Will attempt to connect or start daemon
debug: Found socket at /var/run/boss/user.socket
debug: Connecting to daemon on /var/run/boss/user.socket
debug: Connected to daemon
debug: Timeoutifying remote method startProcess
debug: Timeoutifying remote method listProcesses
debug: Timeoutifying remote method setClusterWorkers
debug: Timeoutifying remote method findProcessInfoById
debug: Timeoutifying remote method findProcessInfoByPid
debug: Timeoutifying remote method dumpProcesses
debug: Timeoutifying remote method restoreProcesses
debug: Timeoutifying remote method sendSignal
debug: Exposing server user methods
debug: Found socket at /var/run/boss/admin.socket
debug: Connecting to daemon on /var/run/boss/admin.socket
debug: Connected to daemon
debug: Timeoutifying remote method kill
debug: Timeoutifying remote method remoteHostConfig
debug: Timeoutifying remote method addRemoteUser
debug: Timeoutifying remote method removeRemoteUser
debug: Timeoutifying remote method listRemoteUsers
debug: Timeoutifying remote method rotateRemoteUserKeys
debug: Exposing server admin methods
debug: Starting process /Users/alan/Code/project/keystone.js user=alan, group=admin, name=project, argv=[], execArgv=[]
debug: boss:log:debug date=1417004531834, message=Creating process info /Users/alan/Code/project/keystone.js
debug: boss:log:debug date=1417004533485, message=Creating remote process to connect to /var/run/boss/processes/7543
debug: boss:log:debug date=1417004533502, message=Connected to remote
debug: boss:log:debug date=1417004533502, message=Creating remote method startDnodeServer
debug: boss:log:debug date=1417004533502, message=Creating remote method kill
debug: boss:log:debug date=1417004533502, message=Creating remote method restart
debug: boss:log:debug date=1417004533503, message=Creating remote method send
debug: boss:log:debug date=1417004533504, message=Creating remote method reportStatus
debug: boss:log:debug date=1417004533504, message=Creating remote method dumpHeap
debug: boss:log:debug date=1417004533504, message=Creating remote method forceGc
info: /Users/alan/Code/project/keystone.js started with pid 7543
debug: Disconnecting from daemon
debug: Disconnected from daemon
debug: Disconnecting from daemon
debug: Disconnected from daemon
sh-3.2# bs
pid user group name uptime restarts cpu rss heap size heap used status type
7444 alan staff project 7 minutes 0 0.00 115.1MB 88.3MB 53.1MB running Process
sh-3.2#
Is there a way to provide a set of env variables when starting a process?
Can I receive an event about that and send the input programatically?
After a bs kill
, when I start bs
and get an initial list of processes with not yet known status ? if I then bs list
quickly whilst the processes are starting up I got an error Cannot call method 'toFixed' of null
PID User Group Name Uptime Restarts CPU RSS Heap size Heap used Status Type
? alex staff http-server.js ? 0 ? ? ? ? stopped Process
990 alex staff talky.js a few seconds 0 0.00 29.4MB 16.2MB 8.9MB running Process
1004 alex staff intermittently-crashy.js a few seconds 1 0.00 28.9MB 16.2MB 7.5MB running Process
Alexs-MBP:boss-cli alex$ bs stop talky.js intermittently-crashy.js
error: Callback was already called.
Alexs-MBP:boss-cli alex$ bs list
PID User Group Name Uptime Restarts CPU RSS Heap size Heap used Status Type
? alex staff http-server.js ? 0 ? ? ? ? stopped Process
? alex staff talky.js ? 0 ? ? ? ? stopped Process
1013 alex staff intermittently-crashy.js a few seconds 2 0.00 29.3MB 16.2MB 7.8MB running Process
If I currently kill guvnor and restart it, all the processes that ran before get started again.
Is there a possibility to avoid this? Something such as a --no-restart
parameter?
I've followed all the steps on the docs, and after configuring and running guv-web, I only get a JSON response like this when I visit the web URL (https://localhost:<port>/
).
{
"method": "methods",
"arguments": [
{
"findProcessInfoById": "[Function]",
"getServerStatus": "[Function]",
"listProcesses": "[Function]",
"deployApplication": "[Function]",
"removeApplication": "[Function]",
"listApplications": "[Function]",
"switchApplicationRef": "[Function]",
"listApplicationRefs": "[Function]",
"updateApplicationRefs": "[Function]",
"startProcess": "[Function]",
"removeProcess": "[Function]",
"_connectToProcess": "[Function]",
"getDetails": "[Function]"
}
],
"callbacks": {
"7yl5gZ-xO": [
"0",
"findProcessInfoById"
],
"Qy-9gWbxu": [
"0",
"getServerStatus"
],
"XkMqeWblu": [
"0",
"listProcesses"
],
"7yQcgZWxu": [
"0",
"deployApplication"
],
"mk4cxZbg_": [
"0",
"removeApplication"
],
"7yrcx-WeO": [
"0",
"listApplications"
],
"XyI9gb-gu": [
"0",
"switchApplicationRef"
],
"myv9xZbxd": [
"0",
"listApplicationRefs"
],
"7J_9xb-l_": [
"0",
"updateApplicationRefs"
],
"XJY9gZbxu": [
"0",
"startProcess"
],
"mk5cgWbeu": [
"0",
"removeProcess"
],
"7ko9xWWe_": [
"0",
"_connectToProcess"
],
"Qkn9gbZld": [
"0",
"getDetails"
]
},
"links": []
}
Am I missing something?
For the SSL termination bit, we could store the client's private key in a keyring for boss:
$ bs key add myKey /path/to/key/file
$ bs key list
myKey ===234lkjxx...
anotherKey ===390`hzis...
$ bs key rm anotherKey
$ bs key list
myKey ===234lkjxx...
Connections would be something like:
- Client connects to server, sends RSA public key
- Server verifies that it has the matching private key dropping the connection if not.
It can then either use the public key to send traffic to the client and the private key to decrypt it, or generate a symmetric key, sign it with the client's public key, send it to the client and use that for all subsequent traffic. The benefit is that symmetric key encryption is a lot cheaper than asymmetric.
If the user has put the client app's private key on the server we could treat that as authentication, much like when you configure ssh to connect to a server without a password.
I really like this web interface, more featured than PM2-web, however I cant seem for the life of me to find any information on what guvnor is or how to get it.
Any help greatly appreciated.
See this section ;-)
...so people know it exists
It would be nice if:
# bs list -v
debug: Loaded config from 0=/etc/boss/bossrc, 1=/usr/local/lib/node_modules/process-boss/bossrc
warn: Boss has been configured to start with the group 'boss' but that group does not exist
prompt: create group 'boss' [Y/n]: (Y) Y
debug: Creating group boss
debug: /usr/sbin/groupadd boss
Usage: groupadd [options] GROUP
Options:
-f, --force exit successfully if the group already exists,
and cancel -g if the GID is already used
-g, --gid GID use GID for the new group
-h, --help display this help message and exit
-K, --key KEY=VALUE override /etc/login.defs defaults
-o, --non-unique allow to create groups with duplicate
(non-unique) GID
-p, --password PASSWORD use this encrypted password for the new group
-r, --system create a system account
debug: Will attempt to connect or start daemon
debug: Connecting to daemon on /var/run/boss/user.socket
debug: Socket file did not exist - the daemon is probably not running
debug: Daemon was not running so will start it
debug: Starting daemon
error: Uncaught exception group id does not exist
error: Error: group id does not exist
at LocalDaemonStarter._startDaemonWithDebugPort (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemonStarter.js:52:22)
at LocalDaemonStarter.start (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemonStarter.js:33:10)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemon.js:93:32)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemonConnection.js:117:14)
at D.emit (events.js:117:20)
at Socket.<anonymous> (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/index.js:65:14)
at Socket.emit (events.js:117:20)
at net.js:441:14
at process._tickCallback (node.js:442:13)
---- async ----
at fireErrorCallbacks (net.js:440:15)
at Socket._destroy (net.js:476:3)
at Object.afterConnect [as oncomplete] (net.js:896:10)
---- async ----
at maybeReadMore (_stream_readable.js:440:13)
at readableAddChunk (_stream_readable.js:168:7)
at ReadStream.Readable.push (_stream_readable.js:128:10)
at TTY.onread (net.js:529:21)
---- async ----
at maybeReadMore (_stream_readable.js:440:13)
at readableAddChunk (_stream_readable.js:168:7)
at ReadStream.Readable.push (_stream_readable.js:128:10)
at TTY.onread (net.js:529:21)
---- async ----
at onwrite (_stream_writable.js:266:15)
at WritableState.onwrite (_stream_writable.js:97:5)
at WriteStream.Socket._write (net.js:654:5)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at WriteStream.Writable.write (_stream_writable.js:183:11)
at WriteStream.Socket.write (net.js:616:40)
at MuteStream.ondata (stream.js:51:26)
at MuteStream.emit (events.js:95:17)
at MuteStream.write (/usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/read/node_modules/mute-stream/mute.js:116:8)
at Object.cursorTo (readline.js:1113:12)
at Interface._refreshLine (readline.js:255:11)
at Interface.prompt (readline.js:175:10)
at read (/usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/read/lib/read.js:51:6)
at EventEmitter.prompt.getInput (/usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:502:3)
at get (/usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:321:12)
at /usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:280:7
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:134:13)
at Object.async.eachSeries (/usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:150:9)
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:279:11)
at EventEmitter.prompt.get (/usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:320:3)
at CLI._checkBossGroup (/usr/local/lib/node_modules/process-boss/lib/CLI.js:292:20)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:610:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:249:17
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:149:13)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:160:25
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:251:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:615:34
at CLI._checkBossUser (/usr/local/lib/node_modules/process-boss/lib/CLI.js:232:12)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:610:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:249:17
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:149:13)
at async.eachSeries (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:165:9)
at _asyncMap (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:248:13)
at Object.mapSeries (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:231:23)
at Object.async.series (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:608:19)
at CLI.afterPropertiesSet (/usr/local/lib/node_modules/process-boss/lib/CLI.js:32:9)
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:929:3
---- async ----
at Container.create (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:116:13)
at Container.createAndRegister (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:88:29)
at Object.<anonymous> (/usr/local/lib/node_modules/process-boss/index.js:40:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/process-boss/bin/bs:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
The web interface needs an equivalent of the cli updaterefs [options] <appName>
command.
I just installed process-boss v2.6.3
on OS X running Node.js v0.12.0 via Homebrew. Installation went fine, save for a few deprecation warnings (which I suppose were because of Node 0.12), but when I tried to start boss, here's the error I got.
sudo bs -v
debug: Loaded config from 0=/usr/local/lib/node_modules/process-boss/bossrc
warn: Boss has been configured to start with the group 'boss' but that group does not exist
prompt: create group 'boss' [Y/n]: (Y) y
debug: Creating group boss
error: Uncaught exception Command failed: which groupadd
error: Error: Command failed: which groupadd
at checkExecSyncError (child_process.js:1339:13)
at Object.execSync (child_process.js:1379:13)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/lib/cli/CLI.js:319:28)
at /usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:316:32
at /usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:142:25
at assembler (/usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:313:9)
at /usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:322:32
at /usr/local/lib/node_modules/process-boss/node_modules/prompt/lib/prompt.js:597:5
at Interface.onLine (/usr/local/lib/node_modules/process-boss/node_modules/prompt/node_modules/read/lib/read.js:111:5)
at Interface.emit (events.js:107:17)
I took a quick look at the code, and I see that you're try-catching groupadd
(which is a Linux command), and moving on to dscl
, which should be used for OS X. I am not entirely sure why the try-catch didn't work, though. Is there some more data I could provide to debug this issue?
# bs kill
warn: You do not appear to have sufficient permissions
When attempting to restart and/or stop processes via guv-web, I receive a vague error stating:
Stop error
process on HOST has failed to stop - undefined
or
Restart error
process on HOST failed to restart - undefined
At first I thought it was a permissions issue since I am running the processes as root:root, however I verified that I am also running guv-web as root - so permissions should not be a factor.
root@ubuntu:~# cnpm i -g process-boss
npm WARN engine [email protected]: wanted: {"node":"<0.11.7"} (current: {"node":"0.11.14","npm":"2.1.10"})
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/posix
> node-gyp rebuild
sh: 1: node-gyp: Permission denied
npm WARN engine [email protected]: wanted: {"node":"0.6.x"} (current: {"node":"0.11.14","npm":"2.1.10"})
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/node_modules/weak
> node-gyp rebuild
sh: 1: node-gyp: Permission denied
npm WARN optional dep failed, continuing [email protected]
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/node_modules/heapdump
> node-gyp rebuild
sh: 1: node-gyp: Permission denied
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/node_modules/usage
> node-gyp rebuild
sh: 1: node-gyp: Permission denied
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/node_modules/node-inspector/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
/
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/execSync
> node install.js
sh: 1: node: Permission denied
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/node_modules/node-inspector/node_modules/v8-debug
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
> [email protected] install /root/.nvm/v0.11.14/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/node_modules/node-inspector/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "node" "/root/.nvm/v0.11.14/lib/node_modules/cnpm/node_modules/.bin/npm" "--userconfig=/root/.cnpmrc" "--disturl=https://npm.taobao.org/dist" "--cache=/root/.npm/.cache_cnpm" "--registry=https://registry.npm.taobao.org" "i" "-g" "process-boss"
npm ERR! node v0.11.14
npm ERR! npm v2.1.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the posix package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls posix
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
We're seeing values not staying in their columns...
pid user group title uptime restarts memory cpu
xxxxx tableflip tableflip Pelican:9008 7863.792523339391 0 98750464 0.010104582428146306
xxxxx dave dave david:1337 7824.78814920783 0 77725696 0.5709089071902701
xxxxx tableflip tableflip tableflip:2368 7194.145791597664 0 57782272 0
title david:1337
has slipped into the group column.
running npm install -g process-boss
, I get the following error
> [email protected] install /home/myuserdir/.nvm/v0.10.35/lib/node_modules/process-boss/node_modules/boss-mdns
> node-gyp rebuild
make: entering the directory « /home/myuserdir/.nvm/v0.10.35/lib/node_modules/process-boss/node_modules/boss-mdns/build »
CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../src/dns_sd.cpp:1:0:
../src/mdns.hpp:32:20: fatal error: dns_sd.h : No such a file or directory
compilation finished.
make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: leaving the directory « /home/myuserdir/.nvm/v0.10.35/lib/node_modules/process-boss/node_modules/boss-mdns/build »
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/myuserdir/.nvm/v0.10.35/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.11.0-23-generic
gyp ERR! command "node" "/home/myuserdir/.nvm/v0.10.35/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
cwd /home/myuserdir/.nvm/v0.10.35/lib/node_modules/process-boss/node_modules/boss-mdns
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
NB: I had to translate some lines of the above report from French, it might not be the exact terms
# bs list -v
debug: Loaded config from 0=/etc/boss/bossrc, 1=/usr/local/lib/node_modules/process-boss/bossrc
debug: Will attempt to connect or start daemon
debug: Connecting to daemon on /var/run/boss/user.socket
debug: Connected to daemon on /var/run/boss/user.socket
debug: Timeoutifying remote method startProcess
debug: Timeoutifying remote method listProcesses
debug: Timeoutifying remote method setClusterWorkers
debug: Timeoutifying remote method findProcessInfoById
debug: Timeoutifying remote method findProcessInfoByPid
debug: Timeoutifying remote method findProcessInfoByName
debug: Timeoutifying remote method dumpProcesses
debug: Timeoutifying remote method restoreProcesses
debug: Timeoutifying remote method sendSignal
debug: Exposing remote method without timeout deployApplication
debug: Exposing remote method without timeout removeApplication
debug: Timeoutifying remote method listApplications
debug: Exposing remote method without timeout switchApplicationRef
debug: Timeoutifying remote method listApplicationRefs
debug: Timeoutifying remote method updateApplicationRefs
debug: Exposing server user methods
debug: Connecting to daemon on /var/run/boss/admin.socket
debug: Connected to daemon on /var/run/boss/admin.socket
debug: Timeoutifying remote method kill
debug: Timeoutifying remote method remoteHostConfig
debug: Timeoutifying remote method addRemoteUser
debug: Timeoutifying remote method removeRemoteUser
debug: Timeoutifying remote method listRemoteUsers
debug: Timeoutifying remote method rotateRemoteUserKeys
debug: Timeoutifying remote method generateRemoteRpcCertificates
debug: Exposing server admin methods
error: Uncaught exception Cannot call method 'toFixed' of undefined
error: TypeError: Cannot call method 'toFixed' of undefined
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/lib/Processes.js:38:62)
at /usr/local/lib/node_modules/process-boss/lib/Processes.js:45:9
at Array.forEach (native)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/lib/Processes.js:44:17)
at /usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/timeoutify/lib/timeoutify.js:34:29
at Proto.apply (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/node_modules/dnode-protocol/index.js:123:13)
at Proto.handle (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/node_modules/dnode-protocol/index.js:99:19)
at D.dnode.handle (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/lib/dnode.js:140:21)
at D.dnode.write (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/lib/dnode.js:106:22)
at write (_stream_readable.js:602:24)
at flow (_stream_readable.js:611:7)
at Socket.pipeOnReadable (_stream_readable.js:643:5)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at Pipe.onread (net.js:529:21)
---- async ----
at Object.exports.connect.exports.createConnection (net.js:95:35)
at D.connect (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/dnode/index.js:52:22)
at LocalDaemonConnection._connect (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemonConnection.js:69:16)
at LocalDaemonConnection.connect (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemonConnection.js:60:15)
at LocalDaemon._connectOrStartDaemon (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemon.js:85:35)
at LocalDaemon.connectOrStart (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/lib/LocalDaemon.js:68:10)
at module.exports.connect (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/index.js:55:35)
at Actions._do (/usr/local/lib/node_modules/process-boss/lib/Actions.js:39:8)
at Processes.list (/usr/local/lib/node_modules/process-boss/lib/Processes.js:17:8)
at Command.listener (/usr/local/lib/node_modules/process-boss/node_modules/commander/index.js:286:8)
at Command.emit (events.js:98:17)
at Command.parseArgs (/usr/local/lib/node_modules/process-boss/node_modules/commander/index.js:528:12)
at Command.parse (/usr/local/lib/node_modules/process-boss/node_modules/commander/index.js:414:21)
at CLI._setUpCommander (/usr/local/lib/node_modules/process-boss/lib/CLI.js:222:33)
at null.<anonymous> (/usr/local/lib/node_modules/process-boss/lib/CLI.js:38:10)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:254:17
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:157:25
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:251:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:615:34
at CLI._checkBossGroup (/usr/local/lib/node_modules/process-boss/lib/CLI.js:286:12)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:610:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:249:17
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:149:13)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:160:25
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:251:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:615:34
at CLI._checkBossUser (/usr/local/lib/node_modules/process-boss/lib/CLI.js:232:12)
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:610:21
at /usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:249:17
at iterate (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:149:13)
at async.eachSeries (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:165:9)
at _asyncMap (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:248:13)
at Object.mapSeries (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:231:23)
at Object.async.series (/usr/local/lib/node_modules/process-boss/node_modules/async/lib/async.js:608:19)
at CLI.afterPropertiesSet (/usr/local/lib/node_modules/process-boss/lib/CLI.js:32:9)
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:929:3
---- async ----
at Container.create (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:116:13)
at Container.createAndRegister (/usr/local/lib/node_modules/process-boss/node_modules/wantsit/lib/Container.js:88:29)
at Object.<anonymous> (/usr/local/lib/node_modules/process-boss/index.js:40:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/process-boss/bin/bs:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
I've set up guvnor and had the (bad) idea to start guvnor-web without first configuring it.
Now I have ended up with a running guvnor-web that starts and crashes immediately. Of course it get's restarted and it crashes again. And so on and so on …
How do I stop this?
If I run
$ guv stop guvnor-web
I get:
error: No socket defined
If I try to
$ guv remove guvnor-web
I get:
error: Process undefined is still running
If I try to stop the process by its pid, I'd need to capture the correct PID. But since it gets restarted every few milliseconds, I don't have an idea of how to get the correct one.
The only thing I can do is
$ sudo guv kill
but then everything else is being killed, too. And it still leaves the problem of how to shutdown guvnor-web correctly. If I then run
$ sudo guv list
again, it's up again, and gets restarted forever :-(
What should I do?
In the context of #53 I had the idea, what if there was a project-specific configuration file?
Basically, something such as guvnor.yml
may be a good idea, similar to CircleCI's circle.yml
or TravisCI's travis.yml
that describes things such as which user has access to the project via guvnor, what the limits are (think #53), and possibly other things…
This would have the advantage that configuration is stored with the application, and it is also automatically versioned, backed up and you have a change log.
What do you think about this?
make: Leaving directory '/usr/local/lib/node_modules/process-boss/node_modules/node-inspector/node_modules/v8-profiler/build'
npm ERR! EEXIST, open '/root/.npm/dbc90e16-ersand-version-1-0-2-package-tgz.lock'
File exists: /root/.npm/dbc90e16-ersand-version-1-0-2-package-tgz.lock
Move it away, and try again.
npm ERR! System Linux 3.12.35+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "process-boss"
npm ERR! cwd /root
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! path /root/.npm/dbc90e16-ersand-version-1-0-2-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
Tried 3 times. Also did an npm cache clear
and npm uninstall -g process-boss
beforehand.
I'd like to see a boss api module that you can say "give me a connection to boss", either tcp or unix socket. The object you get back would implement the same api regardless of network transport. The CLI would use the unix socket version and any remote processes would use the tcp one, which would essentially proxy for the unix socket.
If we use Axon, the tcp connection should act as an ssl termination point and enforce some sort of authentication, otherwise anything can kill processes. There is an issue open against Axon for this but it doesn't look like they think it's a priority.
The unix socket variety should fork two background daemons - one very early in the process to start new processes (avoiding pm2's problem of leaking all of pm2 into every running process) and one to service incoming api requests and manipulate the process starter daemon.
Something like:
bs restart all
E.g., inside of a Docker container, if I want to use guvnor
as command, then the Docker container exits as soon as the application has been started, since guvnor itself exits.
pm2 has a --no-daemon
parameter for this.
How do I do this with guvnor?
hi, thank you for this project!
what would it take to make it run a coffeescript program?
Taking inspiration on what they are doing at node-supervisor, I tried, full of hope, to just replace which node
executor by which coffee
without much success...
It fails when ProcessWrapper.prototype._startProcess
tries to require(script)
: I guess you can't require a coffeescript module from normal javascript, is that it? If so, it could only work if the whole boss was converted to coffeescript, right?
I think we'll have to pass these from the CLI, to BossRPC and finally to the started process.
@achingbrain do we just grab the current process.env
or make it an explicit env
subarg. I think I'm leaning towards the latter.
I have the node manager "n" to switch to 0.10.36 and boss still throws and error. I console logged the version boss is seeing around line: https://github.com/tableflip/boss/blob/b41d5d53b3f5e97f16a21b9f9f15700ef9bb8af7/lib/local/LocalDaemon.js#L28
and this is the output I get:
[vagrant@localhost raventracking]$ sudo bs start -n raven -a '-s raven' tracking/index.js
0.10.22 ### this is from the console.log() I added
error: Failed to start /opt/raventracking/tracking/index.js
error: message=Script tracking/index.js does not exist, code=INVALID ## Also this is not correct. The file is there. I tabbed to get to it so bash definitely sees it.
[vagrant@localhost raventracking]$ node -v
v0.10.36 ## node -v is saying it higher than the required 0.10.29
Any thoughts?
When I tried to install boss under io.js 1.1.0, it failed due to the usage
module. It seems as if its installation has a bug with io.js 1.1.0.
Any thoughts on this?
Regarding the guv-web interface:
I see the ability to restrict access for users on a per-host/server basis, but not a per-process basis. I would like to see this implemented (or if it's already possible, explain how it is done as I couldn't find anything in the documentation).
Reason being is I run multiple Ghost blogs on a single server, but want multiple users to be able to log into the web interface to restart, check logs, etc of their Ghost blog (or process). As of right now they have access to everyone else's Ghost blog on that same host.
I've already typed bs web
instead of bs-web
- perhaps boss could spawn a boss web if it is installed?
# bs
warn: Boss has been configured to start with the group 'boss' but that group does not exist
prompt: create group 'boss' [Y/n]: (Y) Y
As guvnor monitors the processes it runs anyway, it would be great if you could assign limits for CPU usage, RAM usage, …
If a process uses more than these limits, it should be restarted.
E.g.: You know that you have a memory leak in your application, but you can't find it. A workaround may be to restart it every time if it uses more than 500 MBytes of memory. Or if it ran longer than 60 minutes. Or ... ;-)
What do you think about this?
$ sudo bs start test.js --user alan --group alan
error: boss:log:error date=1416922309850, message=Child process 92a947fd-d759-4e61-9787-a3eee35db242 test.js (19946) experienced an uncaught exception Error: groupname not found
at Object.exports.gid (/usr/local/lib/node_modules/process-boss/node_modules/userid/lib/userid.js:39:18)
at UserInfo.afterPropertiesSet (/usr/local/lib/node_modules/process-boss/node_modules/boss-local/node_modules/boss-daemon/lib/common/UserInfo.js:13:30)
at process._tickCallback (node.js:419:13)
$ sudo bs start test.js --user alan
error: test.js failed to start
^C
Where test.js is:
throw new Error('kerpow')
In this section, the link to the default configuration file results in a 404.
Really minor, but the logged pid is not the same as the process pid when using -v
...
info: /Users/alan/Code/project/keystone.js started with pid 3399
debug: Disconnecting from daemon
debug: Disconnected from daemon
debug: Disconnecting from daemon
debug: Disconnected from daemon
$ sudo bs
pid user group name uptime restarts cpu rss heap size heap used status type
3398 root wheel keystone.js a few seconds 0 0.00 114.3MB 88.3MB 52.6MB running Process
Im using this syntax but it's not working:
sudo guv start -n ProcessName -a '--username blabla --password blabla --port 3003' app.js
Those arguments aren't getting to the process :(
What am I doing wrong?
$ sudo bs start keystone.js -v -u alan
debug: Loaded config from 0=/usr/local/lib/node_modules/process-boss/bossrc
debug: Will attempt to connect or start daemon
debug: Found socket at /var/run/boss/user.socket
debug: Connecting to daemon on /var/run/boss/user.socket
debug: Socket file did not exist - the daemon is probably not running
debug: Daemon was not running so will start it
debug: Starting daemon
debug: Daemon requested config
debug: Daemon process online
debug: Disconnected from Daemon process
debug: Daemon started and listening on undefined
debug: Found socket at /var/run/boss/user.socket
debug: Connecting to daemon on /var/run/boss/user.socket
debug: Connected to daemon
debug: Timeoutifying remote method startProcess
debug: Timeoutifying remote method listProcesses
debug: Timeoutifying remote method setClusterWorkers
debug: Timeoutifying remote method findProcessInfoById
debug: Timeoutifying remote method findProcessInfoByPid
debug: Timeoutifying remote method dumpProcesses
debug: Timeoutifying remote method restoreProcesses
debug: Timeoutifying remote method sendSignal
debug: Exposing server user methods
debug: Found socket at /var/run/boss/admin.socket
debug: Connecting to daemon on /var/run/boss/admin.socket
debug: Connected to daemon
debug: Timeoutifying remote method kill
debug: Timeoutifying remote method remoteHostConfig
debug: Timeoutifying remote method addRemoteUser
debug: Timeoutifying remote method removeRemoteUser
debug: Timeoutifying remote method listRemoteUsers
debug: Timeoutifying remote method rotateRemoteUserKeys
debug: Exposing server admin methods
debug: Starting process /Users/alan/Code/project/keystone.js user=alan, group=wheel, argv=[], execArgv=[]
debug: boss:log:debug date=1416998693714, message=Creating process info /Users/alan/Code/project/keystone.js
debug: boss:log:debug date=1416998695272, message=Creating remote process to connect to /var/run/boss/processes/3628
debug: boss:log:debug date=1416998695293, message=Connected to remote
debug: boss:log:debug date=1416998695293, message=Creating remote method startDnodeServer
debug: boss:log:debug date=1416998695294, message=Creating remote method kill
debug: boss:log:debug date=1416998695295, message=Creating remote method restart
debug: boss:log:debug date=1416998695295, message=Creating remote method send
debug: boss:log:debug date=1416998695295, message=Creating remote method reportStatus
debug: boss:log:debug date=1416998695296, message=Creating remote method dumpHeap
debug: boss:log:debug date=1416998695296, message=Creating remote method forceGc
debug: boss:log:debug date=1416998695444, message=Creating remote process to connect to /var/run/boss/processes/3629
debug: boss:log:debug date=1416998695458, message=Connected to remote
debug: boss:log:debug date=1416998695459, message=Creating remote method startDnodeServer
debug: boss:log:debug date=1416998695459, message=Creating remote method kill
debug: boss:log:debug date=1416998695459, message=Creating remote method restart
debug: boss:log:debug date=1416998695460, message=Creating remote method send
debug: boss:log:debug date=1416998695460, message=Creating remote method reportStatus
debug: boss:log:debug date=1416998695461, message=Creating remote method dumpHeap
debug: boss:log:debug date=1416998695461, message=Creating remote method forceGc
info: /Users/alan/Code/project/keystone.js started with pid 3629
debug: Disconnecting from daemon
debug: Disconnected from daemon
debug: Disconnecting from daemon
debug: Disconnected from daemon
$ bs
pid user group name uptime restarts cpu rss heap size heap used status type
3628 root wheel keystone.js a few seconds 0 0.00 113.8MB 87.3MB 52.6MB running Process
$ ps -u root
UID PID TTY TIME CMD
0 3628 ?? 0:01.80 keystone.js
pm2 uses axon-rpc for message passing between the cli and the daemon, which seems sensible. They pass messages over tcp sockets, and axon doesn't support authentication which is why any old user can kill processes even though pm2 runs as root.
One solution is to use unix sockets instead. Axon uses node's socket api to do the actual network portion, and that supports unix sockets - at that point it's all filesystem privileges so very easy to configure. Problem is visionmedia is thinking of removing unix socket support from Axon as the performance is poor vs tcp (this performance difference is not something we would notice).
Might be worth investigating another library, or just using Axon but isolating it in the codebase so we can easily pull it out later.
An alternative is zeromq but the node module requires a separate install of zmq which is dull. Axon at least is self contained.
More details to follow...
$ bs -v
error: unknown option '-v'
$ bs --version
error: unknown option '--version'
$ bs -V
error: unknown option '-V'
Guvnor starts node-inspector on a random port and then allocates debug ports to each process randomly. With Docker ports need to be known in advance in order to forward them, so we can't access the debugger.
Refactor port allocation out into a service that either allocates from a known port range or falls back to randomly chosen open ports.
I use guvnor inside a docker container and run 4 processes. Everything seems fine for about a half day or so. I can see that the memory usage of the Node.js apps go up as the time goes by on the web UI. And next day when I check the the web UI I don't see the server in the list and when I check the server the guvnor daemon is not running. There is nothing special in the /var/log/guvnor directory. Is there any way I can find out what causes the crash? The docker container is limited to use 2G memory. Thanks.
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.