From 323c8b669df2427108c120438447eadc613ba031 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 5 Apr 2014 15:47:00 -0600 Subject: [PATCH] Removed posix module from being installed by default --- init.js | 13 ++++++++++--- package.json | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/init.js b/init.js index 1a7a51b..9cd58b2 100644 --- a/init.js +++ b/init.js @@ -4,7 +4,6 @@ var os = require('os'); var cluster = require('cluster'); var async = require('async'); -var posix = require('posix'); var PoolLogger = require('./libs/logUtil.js'); var BlocknotifyListener = require('./libs/blocknotifyListener.js'); var RedisBlocknotifyListener = require('./libs/redisblocknotifyListener.js'); @@ -41,10 +40,18 @@ try { //Try to give process ability to handle 100k concurrent connections try{ - posix.setrlimit('nofile', { soft: 100000, hard: 100000 }); + var posix = require('posix'); + try { + posix.setrlimit('nofile', { soft: 100000, hard: 100000 }); + } + catch(e){ + if (cluster.isMaster) + logger.warning('POSIX', 'Connection Limit', '(Safe to ignore) Must be ran as root to increase resource limits'); + } } catch(e){ - logger.warning('POSIX', 'Connection Limit', '(Safe to ignore) Must be ran as root to increase resource limits'); + if (cluster.isMaster) + logger.debug('POSIX', 'Connection Limit', '(Safe to ignore) POSIX module not installed and resource (connection) limit was not raised'); } diff --git a/package.json b/package.json index a6abc57..24e73b1 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "stratum-pool": "git://github.com/zone117x/node-stratum-pool.git", "dateformat": "*", "node-json-minify": "*", - "posix": "*", "redis": "*", "mysql": "*", "async": "*",