[pve-devel] [PATCH manager v2] Fix #1386: track postfix daemon status via postfix at -

Emmanuel Kasper e.kasper at proxmox.com
Thu May 18 11:10:52 CEST 2017


---
IMHO #1387 has a different scope. This patch here deals with 
fixing the default reporting when a the status of one of our
default daemon is reported in a different unit.
#1387 is about *manually* changing the default startup of a 
service to socket activation, and then not getting the proper
status afterwards in the status api call for this service.

 PVE/API2/Services.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Services.pm b/PVE/API2/Services.pm
index 3ddf5f56..d031a3a6 100644
--- a/PVE/API2/Services.pm
+++ b/PVE/API2/Services.pm
@@ -35,9 +35,16 @@ my $service_name_list = [
     'systemd-timesyncd',
     ];
 
+# since postfix package 3.1.0-3.1 the postfix unit is only here to
+# manage subinstances, of which the  default is called "-".
+# This is where we look for the daemon status
+my $unit_extra_names = {
+    postfix => 'postfix at -'
+};
+
 my $get_full_service_state = sub {
     my ($service) = @_;
-
+    $service = $unit_extra_names->{$service} if $unit_extra_names->{$service};
     my $res;
     
     my $parser = sub {
-- 
2.11.0





More information about the pve-devel mailing list