Mercurial > hg > rlgwebd
annotate rlgwebd-stop @ 198:ea28353d620a
Make sure games have saved and exited before stopping the server.
This should make the systemd version safe for production, though
it can't yet deal with a game that hangs and doesn't exit.
author | John "Elwin" Edwards |
---|---|
date | Thu, 28 Jan 2016 21:17:06 -0500 |
parents | 3bdee6371c3f |
children | a7cc38a0168d |
rev | line source |
---|---|
193 | 1 #!/usr/bin/env node |
2 | |
3 var net = require('net'); | |
194
5483d413a45b
RLGWebD: move the control socket into /var/run.
John "Elwin" Edwards
parents:
193
diff
changeset
|
4 var sockpath = "/var/run/rlgwebd.sock"; |
193 | 5 |
6 var sock = net.connect(sockpath, function () { | |
7 sock.on('close', function () { | |
8 if (process.argv[2] == "debug") | |
9 console.log("Control socket closed"); | |
10 }); | |
11 sock.write("quit\n"); | |
12 }); |