Commit 31fffb8c authored by Efthymia Bika's avatar Efthymia Bika

Unlink lockfiles on exit

parent de3ad00d
...@@ -207,7 +207,13 @@ function kill_callback(error, stdout, stderr) { ...@@ -207,7 +207,13 @@ function kill_callback(error, stdout, stderr) {
function kill_processes() { function kill_processes() {
for(var i = 0; i < running_processes.length; i++) { for(var i = 0; i < running_processes.length; i++) {
console.log(running_processes[i]); console.log("About to kill " + running_processes[i][0].pid);
running_processes[i].kill(); running_processes[i][0].kill();
var lockfile =
path.join(BAAS_ARCHIVE_DIR, running_processes[i][1],
"lockfile.lock");
console.log("About to unlink lockfile " + lockfile);
fs.unlinkSync(lockfile);
} }
} }
...@@ -231,7 +231,8 @@ function call_duplicity(mode, backup_set, force) { ...@@ -231,7 +231,8 @@ function call_duplicity(mode, backup_set, force) {
var backup_name = (backup_set) ? var backup_name = (backup_set) ?
backup_set.cloud + "/" + backup_set.name : backup_set.cloud + "/" + backup_set.name :
$("#res-cloud").val() + "/" + $("#res-backup-name"); $("#res-cloud").val() + "/" + $("#res-backup-name");
args.push("--name", SHA256(backup_name)); backup_name = SHA256(backup_name).toString();
args.push("--name", backup_name);
var sel_cloud = (backup_set) ? backup_set.cloud : var sel_cloud = (backup_set) ? backup_set.cloud :
$("#res-cloud").val(); $("#res-cloud").val();
...@@ -244,7 +245,7 @@ function call_duplicity(mode, backup_set, force) { ...@@ -244,7 +245,7 @@ function call_duplicity(mode, backup_set, force) {
// call duplicity // call duplicity
var wProcess = null; var wProcess = null;
wProcess = spawn(ENV_CMD, args, {env: make_env()}); wProcess = spawn(ENV_CMD, args, {env: make_env()});
running_processes.push(wProcess); running_processes.push([wProcess, backup_name]);
var output_str = ""; var output_str = "";
function dup_call_out(data) { function dup_call_out(data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment