Closed maddes-b closed 4 weeks ago
Hmm... I'm pretty sure advertiseaddr
does work, as this is something that recently has been discussed in the forums: under certain circumstances you have to use that configuration to make certain features work. I'm a bit confused there...
Could also be changes in the Perl version, the docker image uses Debian 11 "bullseye" with Perl 5.32.1 On Sunday I will test the Perl argument handling separately and with the logging in the relared sub routine.
This is working on a clean Debian 11 VM:
#!/usr/bin/perl
require 5.010;
use strict;
use Getopt::Long;
package main;
my $user = "otto";
my $group = "jungs";
our $norestart;
sub initOptions {
my $gotOptions = GetOptions(
'user=s' => \$user,
'group=s' => \$group,
'norestart' => \$norestart,
);
print("gotOptions [$gotOptions]\n");
}
sub main
{
print("main starts\n");
print STDERR (join("|",@ARGV),"\n");
# command line options
initOptions();
print("user [$user]\n");
print("group [$group]\n");
print("norestart [$::norestart]\n");
print STDERR (join("|",@ARGV),"\n");
}
main();
[Update 1] Also working in the Docker image. I assume the argument passing is an issue.
[Update 2] It's the passing of the args, I assume it's docker environment related. Log ARGV splitted: --logdir|/config/logs|--cachedir|/config/cache|--httpport|9000|"--advertiseaddr|192.168.1.77|--norestart" (see the quotes from EXTRA_ARGS
Reason: EXTRA_ARGS in Docker configuration had enclosing quotes, which lead to the wrong parametes. Note for myself (and others): do not quote EXTRA_ARGS in your docker config (compose.yaml, etc.)
With 8.5.2 docker image linux/amd64 (sha256:7434f3a6c9cbe2a69b5653d671965c24ed527bbab2301a3e0f8b7d32f5650fbe) it seems that command line arguments are ignored. Tested with
--norestart
and--advertiseaddr
.Log says:
No errors in any log.
But when logging values in Perl, then these are empty, although variables are accessed as done in other places. (tested why
main::canRestartServer()
inslimserver.pl
didn't deny restarts although--norestart
was specified)Result:
Removed outdated
--nomysqueezebox
, tested again, but got same result.Did I find a bug, or do I get something wrong?
Kind regards Maddes
[Update/Solution] EXTRA_ARGS in Docker configuration had enclosing quotes, which lead to the wrong parametes. Note for myself (and others): do not quote EXTRA_ARGS in your docker config (compose.yaml, etc.)
P.S.: While reading Perl 5.31 docs I recognized that
our
only creates aliases to existing variables, which I couldn't find in the source. AndGetOptions()
seems to need existing variables. Do not know if this could be the cause. Not an Perl expert.