virtualmin list-domains --domain $DOMAIN fails

Hi All,

For some reason the command “virtualmin list-domains --domain <my_domain.com>” stopped working on my system.
What’s strange is that “virtualmin list-domains” works fine, lists all the domains, including my_domain.com.

I’m doing this as root, and the system has been working for the last few years ok… any ideas?

Thanks,
-m

I see the problem now, in /etc/webmin/virtual-server all the map.* files are zero bytes. How do I regenerate those?

OK, I added a build_domain_maps command by creating /usr/share/webmin/virtual-server/build_domain_maps.pl
with the following guts :

#!/usr/bin/perl
package virtual_server;
if (!$module_name) {
$main::no_acl_check++;
$ENV{‘WEBMIN_CONFIG’} ||= “/etc/webmin”;
$ENV{‘WEBMIN_VAR’} ||= “/var/webmin”;
if ($0 =~ /^(.*)/[^/]+$/) {
chdir($pwd = $1);
}
else {
chop($pwd = pwd);
}
$0 = “$pwd/list-domains.pl”;
require ‘./virtual-server-lib.pl’;
$< == 0 || die “build_domain_maps.pl must be run as root”;
}
&build_domain_maps();

This is mostly a copy-paste of the list-domains.pl file. Then I run a code +x build_domain_maps.pl, and finally I could run that command as virtualmin build_domain_maps as root. Everything appears be back in business now.

-m