From 33c217c97c71ce4dca967e8c55e1f9340f913074 Mon Sep 17 00:00:00 2001 From: Ryan Cicchiello Date: Fri, 6 Apr 2018 16:09:27 -0400 Subject: [PATCH] Fixed bug where lock file would be deleted after a new process sends aris an ipc message --- libaris/res/edu/rpi/aris/VERSION | 2 +- server/src/edu/rpi/aris/Main.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libaris/res/edu/rpi/aris/VERSION b/libaris/res/edu/rpi/aris/VERSION index 78bae5bb..cd9d21e6 100644 --- a/libaris/res/edu/rpi/aris/VERSION +++ b/libaris/res/edu/rpi/aris/VERSION @@ -1 +1 @@ -0.0.32 +0.0.33 diff --git a/server/src/edu/rpi/aris/Main.java b/server/src/edu/rpi/aris/Main.java index 55b3b080..f83a5e1b 100644 --- a/server/src/edu/rpi/aris/Main.java +++ b/server/src/edu/rpi/aris/Main.java @@ -38,10 +38,9 @@ public static void main(String[] args) throws IOException { System.err.println(e.getMessage()); System.exit(1); } - if (!tryLock()) { + if (ipcFile.exists() || !tryLock()) { logger.info("Program already running"); logger.info("Sending message to running program"); - //TODO if (cmd.hasOption("add-user") && cmd.hasOption("password")) { sendIpcMessage("add-user " + cmd.getOptionValue("add-user") + " " + cmd.getOptionValue("password")); }