Commit 0c00036c authored by Kirill Smelkov's avatar Kirill Smelkov

X hack for Sgo to exit on M shutdown command

parent 60644d0b
......@@ -31,6 +31,7 @@ import (
"context"
"fmt"
"net"
"os"
"sync"
"lab.nexedi.com/kirr/go123/xerr"
......@@ -342,6 +343,12 @@ func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *NotifyNodeInformatio
// XXX recheck locking
// XXX do .MyInfo = nodeInfo ?
app.MyInfo.IdTime = nodeInfo.IdTime
// FIXME hack - better it be separate command and handled cleanly
if nodeInfo.State == DOWN {
log.Info(ctx, "master told us to shutdown")
os.Exit(1)
}
}
}
......
......@@ -40,7 +40,7 @@ xmysql -e "SHUTDOWN"
sleep 1
j="$(jobs -p)"
test -z "$j" && exit
echo "E: killing jobs..."
echo "E: killing left jobs..."
jobs -l
kill $j' EXIT
......
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