services: make reload safer and default to it in gui

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-07-25 20:23:12 +02:00
parent d757021f4c
commit e6b599aa6c
2 changed files with 5 additions and 3 deletions

View File

@ -185,10 +185,11 @@ fn run_service_command(service: &str, cmd: &str) -> Result<Value, Error> {
// fixme: run background worker (fork_worker) ??? // fixme: run background worker (fork_worker) ???
match cmd { let cmd = match cmd {
"start"|"stop"|"restart"|"reload" => {}, "start"|"stop"|"restart"=> cmd,
"reload" => "try-reload-or-restart", // some services do not implement reload
_ => bail!("unknown service command '{}'", cmd), _ => bail!("unknown service command '{}'", cmd),
} };
if service == "proxmox-backup" && cmd == "stop" { if service == "proxmox-backup" && cmd == "stop" {
bail!("invalid service cmd '{} {}' cannot stop essential service!", service, cmd); bail!("invalid service cmd '{} {}' cannot stop essential service!", service, cmd);

View File

@ -26,6 +26,7 @@ Ext.define('PBS.ServerAdministration', {
xtype: 'proxmoxNodeServiceView', xtype: 'proxmoxNodeServiceView',
title: gettext('Services'), title: gettext('Services'),
itemId: 'services', itemId: 'services',
restartCommand: 'reload', // avoid disruptions
startOnlyServices: { startOnlyServices: {
syslog: true, syslog: true,
'proxmox-backup': true, 'proxmox-backup': true,