# # # patch "www/admin-source_control.js" # from [9305375733e72c063e111aa95f360e97415bb135] # to [b3f0fc8dc65e1f0a22f035772789f4247af247d7] # # patch "www/admin-source_control.php" # from [efa1ca7ed548b0f1ad07f7941666273c2a008eee] # to [a6f234c84cf2b5c02a77ac35c77703bf1a3e7082] # # patch "www/admin-source_control_backend.php" # from [cd3cba112b959cf0c1b40ce2c25999aa1b98f9da] # to [f4db016f21ce1c075c30f6787142fe2cbb1169f8] # ============================================================ --- www/admin-source_control.js 9305375733e72c063e111aa95f360e97415bb135 +++ www/admin-source_control.js b3f0fc8dc65e1f0a22f035772789f4247af247d7 @@ -44,6 +44,17 @@ chstate = function() { }); }; +kill_server = function() { + if (!confirm("Do you really want to terminate any open connections?")) + return; + setstatus("Killing server..."); + var args = {'project':project, 'action':"kill"}; + call_server(ctrl, args, "chstate", function(data){ + set_state_display(data.status, data.connections); + clearstatus(); + }); +} + set_state_display = function(state, connections){ if (state == "") { replaceChildNodes("serverstate", "(server not found)"); ============================================================ --- www/admin-source_control.php efa1ca7ed548b0f1ad07f7941666273c2a008eee +++ www/admin-source_control.php a6f234c84cf2b5c02a77ac35c77703bf1a3e7082 @@ -39,6 +39,7 @@ Current server status is "server state"
+
Current connections are:
============================================================ --- www/admin-source_control_backend.php cd3cba112b959cf0c1b40ce2c25999aa1b98f9da +++ www/admin-source_control_backend.php f4db016f21ce1c075c30f6787142fe2cbb1169f8 @@ -33,10 +33,12 @@ if ($action == "getsrv") { } else if ($action === "refresh_state") { print $json->encode(array("status" => usherctrl("STATUS " . $project), "connections" => usherctrl("LISTCONNECTIONS " . $project))); -} else if ($action === "disable" || $action === "enable") { +} else if ($action === "disable" || $action === "enable" || $action === "kill") { if(allowed('server')) { if ($action === "disable") $what = "STOP"; + else if ($action === "kill") + $what = "KILL_NOW"; else $what = "START"; usherctrl("$what $project"); @@ -47,9 +49,11 @@ if ($action == "getsrv") { if(allowed('server')) { if ($args->oath === "I solemnly swear that I have a backup.") { $out = array(); + usherctrl("KILL_NOW $project"); exec("rm $projdir/database* 2>&1", $out, $res1); exec("$monotone -d $projdir/database db init 2>&1", $out, $res2); exec("chmod g+rw $projdir/database 2>&1", $out, $res3); + usherctrl("START $project"); if ($res2 > 0 || $res3 > 0) { $err = ""; if ($res1) $err = $err . "Remove old database failed. ";