# # # patch "doc/documentation.html" # from [ffa3e8b4e5954830dd1d69af2f8e441af0681249] # to [5c0ee5ef7d5ed30a0d018f27c862cb73d3c54a89] # # patch "src/administrator.cc" # from [73fc5c58b6837f79d97ec7c8421285aff4063e1b] # to [96ff493c2ebd661a99f15114338c0d595b160ceb] # # patch "src/server_manager.cc" # from [f56b78561e089b0fa5a944d216b2696412f7b789] # to [1d4f3adcaa7e1b3042e9b57387b9025c01144781] # # patch "src/server_manager.hh" # from [991d7f8b1b45495128a77f0ba793a7dc3401eaf8] # to [5808402a36b08a92cf0ed904d5c0a88807238be5] # ============================================================ --- doc/documentation.html ffa3e8b4e5954830dd1d69af2f8e441af0681249 +++ doc/documentation.html 5c0ee5ef7d5ed30a0d018f27c862cb73d3c54a89 @@ -1,11 +1,8 @@ - - - Usher Documentation - + Usher Documentation

Introduction

This is an 'usher' to allow multiple monotone servers to work from the @@ -55,7 +52,9 @@ of sections each starting with a "Global directives
userpass "username" "password"
-
This defines a username/password combination used to access the administrative interface (see below). You can have any number of userpass lines.
+
This defines a +username/password combination used to access the administrative +interface (see below). You can have any number of userpass lines.
monotone "executable" "arg1" "arg2"
Gives the first part of the command line used when spawning local servers.
The default is monotone "mtn".
@@ -182,10 +181,16 @@ become ACTIVE, and STOPPED servers becom
Allow a STOPPED or STOPPING server to receive connections again. The result will be the new status of that server: STOPPING servers become ACTIVE, and STOPPED servers become SLEEPING. Servers in other -states are not affected.
+states are not affected.
KILL_NOW servername
+
Immediately kill the given local server, dropping any open +connections, and prevent is from receiving new connections and +restarting. The named server will immediately change to state STOPPED.
+
LIST [state]
-
Without an argument, returns a space-separated list of all servers. With an argument, returns a list of all servers which are in the given state.
+
Without an argument, returns a +space-separated list of all servers. With an argument, returns a list +of all servers which are in the given state.
SHUTDOWN
Do not accept new connections for any servers, local or remote. Returns "ok".
============================================================ --- src/administrator.cc 73fc5c58b6837f79d97ec7c8421285aff4063e1b +++ src/administrator.cc 96ff493c2ebd661a99f15114338c0d595b160ceb @@ -184,6 +184,18 @@ administrator::process(cstate & cs) oss<>srv; + try + { + manager.kill_server_now(srv); + cs.buf = "ok\n"; + } + catch (errstr &e) + { + cs.buf = e.name + "\n"; + } } else if (cmd == "LIST") { string state; iss>>state; ============================================================ --- src/server_manager.cc f56b78561e089b0fa5a944d216b2696412f7b789 +++ src/server_manager.cc 1d4f3adcaa7e1b3042e9b57387b9025c01144781 @@ -292,6 +292,17 @@ void } void +server_manager::kill_server_now(string const &srv) +{ + map >::iterator i = by_name.find(srv); + if (i != by_name.end()) { + i->second->enabled = false; + i->second->yeskill(); + } else + throw errstr("No such server."); +} + +void server_manager::kill_old_servers() { set >::iterator i; ============================================================ --- src/server_manager.hh 991d7f8b1b45495128a77f0ba793a7dc3401eaf8 +++ src/server_manager.hh 5808402a36b08a92cf0ed904d5c0a88807238be5 @@ -61,6 +61,7 @@ public: void set_opts(map > const & o); void allow_connections(bool allow=true); string start_stop_server(string const &srv, bool start); + void kill_server_now(string const &srv); void reload_servers(); private: shared_ptr find_server(string const &host,