Minor Changes
- #290
769b445Thanks @tufantunc! -config.tomlcan be reloaded without a restart (#288). A new tool,reload-config, reports the config file's status (path, source, load time and the sha256 of its bytes, never its contents) withaction: "status", and re-reads and applies the file withaction: "reload". Sending the processSIGHUPdoes the same reload, except on Windows. A reload runs every check startup runs, including the permission and ACL check, and applies the file only if all of them pass; a refused reload changes nothing. It also refuses a changed or removeddefaults.transferRoot(adding one is allowed) and a server started from--host/--userflags; both need a restart. Command-line flags are never reloaded. Policy changes apply to open connections from their next command; a removed profile or a changed connection field closes that connection and its sessions, and anything running through it as a bastion. Every applied reload retires the approval grants made before it; an approval answered after a reload is re-checked against the new rules, and so is a decision (an allow, or a grant reuse) that a reload landed in the middle of. A connection still being opened when a reload lands fails only if the reload closes its profile; any other is kept, with the new profile. Reloads run one at a time, and those asked for while one is waiting to start join it. Each reload is audited as oneconfig:reloadrecord: applied, refused, or (ruleconfig-reload-partial) failed after the swap began.reload-configalso answers on a server started without a config, so writing the file and reloading configures it. Behaviour change: outside Windows,SIGHUPno longer stops the server; it triggers a reload. A stdio server still exits when its client closes stdin. An HTTP server started from a terminal is no longer stopped when that terminal closes, since its hangup is now handled; stop it withSIGTERMorSIGINT, or run it under a supervisor. Behaviour change: a config in which two profiles share a name is now refused at startup, and by a reload; before, the server started and used the first of the two.