]> git.proxmox.com Git - proxmox-backup.git/commitdiff
services: make reload safer and default to it in gui
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 25 Jul 2020 18:23:12 +0000 (20:23 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 25 Jul 2020 18:23:12 +0000 (20:23 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/api2/node/services.rs
www/ServerAdministration.js

index 8ecb6dc123eea3735bf8c4fdcf4606b2c85c74cc..923252cd5303b0218b4161d5315192e824bfc776 100644 (file)
@@ -185,10 +185,11 @@ fn run_service_command(service: &str, cmd: &str) -> Result<Value, Error> {
 
     // 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);
index edbc0ee353ce3d2d19a8dfd9ae15c38a987c89b9..076d554321c5a610f85352ced42bedd3569e4756 100644 (file)
@@ -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,