stop
This commit is contained in:
parent
8d916eb8ed
commit
bf068177fb
6
lxc.js
6
lxc.js
@ -54,10 +54,10 @@ module.exports = function(config){
|
||||
};
|
||||
|
||||
|
||||
obj.start = function(name, cbComplete, cbData){
|
||||
obj.start = function(name, callback){
|
||||
var cmd = 'lxc-start --name '+name+' --daemon';
|
||||
console.log('start cmd\n', cmd, '\n');
|
||||
sysExec(cmd, cbComplete, cbData);
|
||||
sysExec(cmd, callback);
|
||||
};
|
||||
|
||||
obj.startEphemeral = function(name, base_name, cbData){
|
||||
@ -85,7 +85,7 @@ module.exports = function(config){
|
||||
sysExec('lxc-unfreeze -n '+name, cbComplete, cbData);
|
||||
};
|
||||
|
||||
obj.info = function(name, cbComplete, cbData){
|
||||
obj.info = function(name, cbData){
|
||||
|
||||
var output = '';
|
||||
sysExec('lxc-info -n'+name, function(data){output+=data}, function(error){
|
||||
|
@ -7,7 +7,7 @@ var lxc = require('../lxc')({sshBind: false/*['/usr/bin/ssh', 'virt@127.0.0.1']*
|
||||
//lxc.startEphemeral('ubuntu_template', 'ue0', function(){console.log('cb1', arguments)}, function(){console.log('cb2', arguments)})
|
||||
|
||||
router.get('/start/:name', function(req, res, next){
|
||||
lxc.start(req.params.name, null, function(status, message){
|
||||
lxc.start(req.params.name, function(status, message){
|
||||
if(status){
|
||||
res.json({status: 500, name: req.params.name, message: message});
|
||||
}else{
|
||||
@ -66,7 +66,7 @@ router.get('/destroy/:name', function(req, res, next){
|
||||
});
|
||||
|
||||
router.get('/info/:name', function(req, res, next){
|
||||
lxc.info(req.params.name, null, function(data){
|
||||
lxc.info(req.params.name, function(data){
|
||||
res.json(data);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user