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) {
function kill_processes() {
for(var i = 0; i < running_processes.length; i++) {
console.log(running_processes[i]);
running_processes[i].kill();
console.log("About to kill " + running_processes[i][0].pid);
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) {
var backup_name = (backup_set) ?
backup_set.cloud + "/" + backup_set.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 :
$("#res-cloud").val();
......@@ -244,7 +245,7 @@ function call_duplicity(mode, backup_set, force) {
// call duplicity
var wProcess = null;
wProcess = spawn(ENV_CMD, args, {env: make_env()});
running_processes.push(wProcess);
running_processes.push([wProcess, backup_name]);
var output_str = "";
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