Trying backend again

This commit is contained in:
Rick Falkvinge
2013-06-05 07:56:01 +00:00
parent 64f50db304
commit 854e6c6a97
2 changed files with 6 additions and 7 deletions
+2 -4
View File
@@ -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");
+4 -3
View File
@@ -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