Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static generation ci #1558

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/munin-node-debug
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ sub service
} elsif ($line =~ m/^fetch (\w+)/) {
my $plugin_number = get_plugin_number($1);
for (my $i = 0; $i < $fields_per_plugin; $i ++) {
my $value = sin( (time / 3600) * $plugin_number + $i) * (4 ** $plugin_number);
my $value = sin( (time / 3600) * $plugin_number + $i) * (4 ** ($plugin_number%5));

$value = int($value * 1024) if ($plugin_number + $i) % 3;
print $client get_ds($plugin_number, $i) . ".value $value\n";
Expand Down
9 changes: 7 additions & 2 deletions lib/Munin/Master/Update.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sub get_dbh {
use Carp;
$db_args{HandleError} = sub { confess(shift) };

my $dbh = DBI->connect("dbi:$db_driver:dbname=$datafilename", $db_user, $db_passwd, \%db_args) or die $DBI::errstr;
my $dbh = DBI->connect_cached("dbi:$db_driver:dbname=$datafilename", $db_user, $db_passwd, \%db_args) or die $DBI::errstr;

INFO 'get_dbh: $dbh->{Driver}->{Name} = ' . $dbh->{Driver}->{Name} . ($is_read_only ? "(ro)" : "(rw)");

Expand Down Expand Up @@ -216,7 +216,12 @@ sub _run_workers {
$res = $worker->do_work();
};

$worker->{dbh}->disconnect();
# Disconnect via removing it from scope
#
# We don't want to call disconnect forcefully, in order to
# fully leverage the reference counting and the automatic call
# to ->DESTROY
delete($worker->{dbh});

my $worker_id = $worker->{ID};
if (! $res || $@) {
Expand Down
7 changes: 6 additions & 1 deletion script/munin-httpd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use Munin::Master::Graph;
use Munin::Master::HTML;
use Munin::Common::Logger;

# Untaint $ENV{PATH}
$ENV{PATH} = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";

sub handle_request {
my $self = shift;
Expand Down Expand Up @@ -41,13 +43,16 @@ my $debug = 0;
my $stdout = 0;
my $loglevel = 'info';

my $max_servers = 10;

print_usage_and_exit()
unless GetOptions(
"listen=s" => \$listen,
"debug" => \$debug,
"stdout" => \$stdout,
"loglevel=s" => \$loglevel,
"version" => \&print_version_and_exit,
"max-servers=i" => \$max_servers,
"help" => \&print_usage_and_exit,
);

Expand Down Expand Up @@ -75,7 +80,7 @@ if ($stdout) {

Munin::Common::Logger::INFO("Starting preforking munin http server at $host:$port");

Munin::Master::Http->new( { host => $host, port => $port } )->run( prefork => 1, max_servers => 10 );
Munin::Master::Http->new( { host => $host, port => $port } )->run( prefork => ($max_servers > 0), max_servers => $max_servers );


sub print_usage_and_exit {
Expand Down
2 changes: 1 addition & 1 deletion web/static/css/materialdesignicons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading