api: service command: fix test for essential service

makes no sense to disallow reload or start (even if start cannot
really happen)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-07-24 19:35:17 +02:00
parent 3da9b7e0dd
commit ee15af6bb8
1 changed files with 2 additions and 2 deletions

View File

@ -190,8 +190,8 @@ fn run_service_command(service: &str, cmd: &str) -> Result<Value, Error> {
_ => bail!("unknown service command '{}'", cmd),
}
if service == "proxmox-backup" && cmd != "restart" {
bail!("invalid service cmd '{} {}'", service, cmd);
if service == "proxmox-backup" && cmd == "stop" {
bail!("invalid service cmd '{} {}' cannot stop essential service!", service, cmd);
}
let real_service_name = real_service_name(service);