Permalink
Browse files

[refactor] Remove last references to chroot, including examples

  • Loading branch information...
1 parent 872db37 commit 36434699142c20a87045fa1e1bb16213935a93d5 @indexzero indexzero committed Jul 8, 2012
File renamed without changes.
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+./bin/carapace --plugin chdir --chdir ./examples/app server.js --port 1337
@@ -1,3 +0,0 @@
-#!/usr/bin/env sh
-
-./bin/carapace --plugin chroot --plugin chdir --chroot ./examples/chroot-jail --chdir . server.js --port 1337
@@ -1,4 +1,5 @@
-var carapace = require('../lib/carapace');
+var path = require('path'),
+ carapace = require('../lib/carapace');
var script = 'server.js',
scriptPort = 31337;
@@ -10,16 +11,16 @@ carapace.on('carapace::plugin::error', function (info) {
});
carapace.use([
- carapace.plugins.heartbeat,
- carapace.plugins.chroot,
+ carapace.plugins.heartbeat,
carapace.plugins.chdir
], function () {
- carapace.chroot('./examples/chroot-jail', console.log.bind(null, 'hello'));
- carapace.chdir('.');
+ carapace.chdir(path.join(__dirname, 'app'));
carapace.run(script, ['--port', scriptPort], function afterRun() {
carapace.heartbeat(function () {
- console.log('bump'.red);
- },1000);
- console.log(script+ ' running on port '+ scriptPort.toString());
+ carapace.on('heartbeat', function () {
+ console.log('still running');
+ });
+ }, 1000);
+ console.log(script + ' running on port ' + scriptPort.toString());
});
});
@@ -15,7 +15,7 @@ var assert = require('assert'),
helper = require('../helper/macros.js'),
carapace = require('../../lib/carapace');
-var script = path.join(__dirname, '..', '..', 'examples', 'chroot-jail', 'server.js');
+var script = path.join(__dirname, '..', '..', 'examples', 'app', 'server.js');
vows.describe('carapace/spawn/local').addBatch({
"When using haibu-carapace": {
@@ -15,7 +15,7 @@ var assert = require('assert'),
helper = require('../helper/macros.js'),
carapace = require('../../lib/carapace');
-var jail = path.join(__dirname, '..', '..', 'examples', 'chroot-jail'),
+var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
custom = path.join(__dirname, '..', 'fixtures', 'custom.js'),
options;
@@ -12,7 +12,7 @@ var assert = require('assert'),
vows = require('vows'),
helper = require('../helper/macros.js');
-var jail = path.join(__dirname, '..', '..', 'examples', 'chroot-jail'),
+var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
custom = path.join(__dirname, '..', 'fixtures', 'pluginserver.js'),
options,
child;
@@ -15,7 +15,7 @@ var assert = require('assert'),
helper = require('../helper/macros.js'),
carapace = require('../../lib/carapace');
-var jail = path.join(__dirname, '..', '..', 'examples', 'chroot-jail'),
+var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
options;
options = {
@@ -15,7 +15,7 @@ var assert = require('assert'),
helper = require('../helper/macros.js'),
carapace = require('../../lib/carapace');
-var jail = path.join(__dirname, '..', '..', 'examples', 'chroot-jail'),
+var jail = path.join(__dirname, '..', '..', 'examples', 'app'),
script = path.join(jail, 'server.js'),
argv = [],
PORT = 5060;
@@ -31,7 +31,7 @@ vows.describe('carapace/run/process').addBatch({
that.callback.apply(null, arguments);
});
},
- "that responds with a cwd inside the chroot jail": function (err, res, body) {
+ "that responds with a cwd inside the app root": function (err, res, body) {
assert.isNull(err);
assert.equal(res.statusCode, 200);
assert.equal(body, process.cwd());

0 comments on commit 3643469

Please sign in to comment.