Skip to content

Commit

Permalink
#244 mlogin could disable Manta's abort-on-core behavior
Browse files Browse the repository at this point in the history
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Approved by: Joshua M. Clulow <jmc@joyent.com>
  • Loading branch information
David Pacheco committed Jul 21, 2017
1 parent a4c4ee8 commit c0685ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## not yet released

## 4.4.3

- joyent/node-manta#244 mlogin could disable Manta's abort-on-core behavior

## 4.4.2

- joyent/node-manta#312 Custom header input should tolerate ':' characters
Expand Down
18 changes: 13 additions & 5 deletions bin/mlogin
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function _log(str) {
}

function parseOptions() {
var opts;
var opts, usercmd;

try {
opts = OPTIONS_PARSER.parse(process.argv);
Expand Down Expand Up @@ -149,12 +149,20 @@ function parseOptions() {
opts.path = manta.path(opts._args[0], true);
}

if (opts.command) {
opts.arguments = [ '-c', opts.command ];
/*
* The default behavior in Manta jobs is that if a process dumps core, then
* the whole task is aborted. That's not appropriate (and pretty annoying)
* for interactive use, so we run the command in our own contract that will
* ignore when a process dumps core.
*/
usercmd = opts.command;
opts.command = '/usr/bin/ctrun';
opts.arguments = [ '-i', 'core', '-l', 'child', '/bin/bash' ];
if (usercmd) {
opts.arguments.push('-c', usercmd);
} else {
opts.arguments = [ '--norc' ];
opts.arguments.push('--norc');
}
opts.command = '/bin/bash';

opts.running = true;
opts.cancel_job = false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "git://github.com/joyent/node-manta.git"
},
"version": "4.4.2",
"version": "4.4.3",
"main": "./lib/index.js",
"dependencies": {
"assert-plus": "^1.0.0",
Expand Down

0 comments on commit c0685ce

Please sign in to comment.