From e6b599aa6ca10de9dffc99afa626dffe047b90b5 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 25 Jul 2020 20:23:12 +0200 Subject: [PATCH] services: make reload safer and default to it in gui Signed-off-by: Thomas Lamprecht --- src/api2/node/services.rs | 7 ++++--- www/ServerAdministration.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api2/node/services.rs b/src/api2/node/services.rs index 8ecb6dc1..923252cd 100644 --- a/src/api2/node/services.rs +++ b/src/api2/node/services.rs @@ -185,10 +185,11 @@ fn run_service_command(service: &str, cmd: &str) -> Result { // fixme: run background worker (fork_worker) ??? - match cmd { - "start"|"stop"|"restart"|"reload" => {}, + let cmd = match cmd { + "start"|"stop"|"restart"=> cmd, + "reload" => "try-reload-or-restart", // some services do not implement reload _ => bail!("unknown service command '{}'", cmd), - } + }; if service == "proxmox-backup" && cmd == "stop" { bail!("invalid service cmd '{} {}' cannot stop essential service!", service, cmd); diff --git a/www/ServerAdministration.js b/www/ServerAdministration.js index edbc0ee3..076d5543 100644 --- a/www/ServerAdministration.js +++ b/www/ServerAdministration.js @@ -26,6 +26,7 @@ Ext.define('PBS.ServerAdministration', { xtype: 'proxmoxNodeServiceView', title: gettext('Services'), itemId: 'services', + restartCommand: 'reload', // avoid disruptions startOnlyServices: { syslog: true, 'proxmox-backup': true,