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) ???
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);

View 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,