PMG::Utils::lookup_real_service_name is only called
for translating the service names provided as arguments
to PMG::API2::Nodes::syslog (for fetching the journal
for specific units). Instead of hardcoding the
version getting it with a call to `psql` seems justified.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
my $service_aliases = {
'postfix' => 'postfix@-',
- 'postgres' => 'postgresql@11-main',
};
sub lookup_real_service_name {
my $alias = shift;
+ if ($alias eq 'postgres') {
+ my $pg_ver = get_pg_server_version();
+ return "postgresl\@${pg_ver}-main";
+ }
+
return $service_aliases->{$alias} // $alias;
}