From 854e6c6a97b4246ec0f00ca267578738698be580 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 5 Jun 2013 07:56:01 +0000 Subject: [PATCH] Trying backend again --- Backend/Program.cs | 6 ++---- Backend/etcinitd/swarmops-backend | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Backend/Program.cs b/Backend/Program.cs index 46bb382c..8d3740b8 100644 --- a/Backend/Program.cs +++ b/Backend/Program.cs @@ -125,8 +125,6 @@ namespace Swarmops.Backend Console.WriteLine(" * Swarmops Backend starting"); - HeartBeater.Instance.Beat(heartbeatFile); - BotLog.Write(0, "MainCycle", "Backend STARTING"); DateTime cycleStartTime = DateTime.Now; @@ -145,7 +143,6 @@ namespace Swarmops.Backend try { - HeartBeater.Instance.Beat(); OnEveryTenSeconds(); if (cycleStartTime.Second < lastSecond) @@ -209,11 +206,12 @@ namespace Swarmops.Backend Console.WriteLine(" * Swarmops Backend stopping"); BotLog.Write(0, "MainCycle", "BACKEND EXITING, sending backend-termination notices"); + /* if (HeartBeater.Instance.WasKilled) { // removed unconditional delete, cron job that restarts bot uses it to know that it is intentionally down. ExceptionMail.Send(new Exception("HeartBeater triggered restart of Swarmops Backend. Will commence after 800 seconds."), false); - } + }*/ BotLog.Write(0, "MainCycle", "...done"); diff --git a/Backend/etcinitd/swarmops-backend b/Backend/etcinitd/swarmops-backend index 2b5d3e77..5c9d6622 100644 --- a/Backend/etcinitd/swarmops-backend +++ b/Backend/etcinitd/swarmops-backend @@ -20,7 +20,8 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Swarmops backend daemon" -NAME=swarmops-backend +NAME=swarmops-back +BINARY=Swarmops.Backend.exe MONO=/usr/bin/mono DAEMON=/opt/swarmops/backend DAEMON_ARGS="--options args" @@ -51,9 +52,9 @@ do_start() # 1 if daemon was already running # 2 if daemon could not be started echo "Starting Swarmops backend..." - start-stop-daemon --start --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --background --test $DAEMON/$NAME > /dev/null \ + start-stop-daemon --start --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --name $NAME --background --test $DAEMON/$BINARY \ || return 1 - start-stop-daemon --start --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --background $DAEMON/$NAME > /dev/null \ + start-stop-daemon --start --pidfile $PIDFILE --exec $MONO --make-pidfile --chdir $DAEMON --name $NAME --background $DAEMON/$BINARY \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend