git://git.novaco.in
/
electrum-server.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
b781bb5
)
clean stop script
author
ThomasV
<thomasv1@gmx.de>
Mon, 17 Feb 2014 17:28:30 +0000 (18:28 +0100)
committer
ThomasV
<thomasv1@gmx.de>
Mon, 17 Feb 2014 17:28:30 +0000 (18:28 +0100)
backends/irc/__init__.py
patch
|
blob
|
history
stop
patch
|
blob
|
history
diff --git
a/backends/irc/__init__.py
b/backends/irc/__init__.py
index
cf830b9
..
8dae94e
100644
(file)
--- a/
backends/irc/__init__.py
+++ b/
backends/irc/__init__.py
@@
-200,6
+200,10
@@
class ServerProcessor(Processor):
elif method == 'server.version':
result = VERSION
+ elif method == 'server.getpid':
+ import os
+ result = os.getpid()
+
elif method == 'server.stop':
self.shared.stop()
result = 'stopping, please wait until all threads terminate.'
diff --git
a/stop
b/stop
index
89b1111
..
42571c5
100755
(executable)
--- a/
stop
+++ b/
stop
@@
-1,2
+1,6
@@
#!/bin/bash
+PID=`/usr/bin/python server.py getpid`
/usr/bin/python server.py stop
+echo "Waiting until process $PID terminates..."
+while ps -p $PID > /dev/null; do sleep 1; done
+echo "Done."