]> git.proxmox.com Git - pmg-api.git/commitdiff
bin/pmg-hourly: use reload-or-restart to reload pmgpolicy service
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Dec 2017 07:16:51 +0000 (08:16 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Dec 2017 07:16:51 +0000 (08:16 +0100)
PMG/Utils.pm
bin/pmg-hourly

index b9c3e2bce44135c37d708d29080a61dd426e95da..563d800e0a841e34bac916e2ddab40d856becaad 100644 (file)
@@ -570,14 +570,10 @@ sub service_cmd {
     my ($service, $cmd) = @_;
 
     die "unknown service command '$cmd'\n"
-       if $cmd !~ m/^(start|stop|restart|reload)$/;
+       if $cmd !~ m/^(start|stop|restart|reload|reload-or-restart)$/;
 
     if ($service eq 'pmgdaemon' || $service eq 'pmgproxy') {
-       if ($cmd eq 'restart') {
-           # OK
-       } else {
-           die "invalid service cmd '$service $cmd': ERROR";
-       }
+       die "invalid service cmd '$service $cmd': ERROR" if $cmd eq 'stop';
     }
 
     $service = $service_aliases->{$service} // $service;
index 82ec20a5c339cefd4d36fc7ac39ea11adc3ad9ff..abdc06bb28c82d9412c34bb5032e76afd448e1a9 100644 (file)
@@ -43,7 +43,7 @@ if ($demo) {
     return;
 }
 
-PMG::Utils::service_cmd('pmgpolicy', 'restart');
+PMG::Utils::service_cmd('pmgpolicy', 'reload-or-restart');
 
 my $ldap_cfg = PVE::INotify::read_file("pmg-ldap.conf");
 PMG::LDAPSet::ldap_resync($ldap_cfg);