From a790b7b41860505b1ec38111052a55a4ec550dd9 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Mon, 13 Jan 2003 02:24:37 +0000 Subject: Avoid unnecessary restarts of the CUPS daemon. --- perl-install/printer/main.pm | 4 +++- perl-install/printer/printerdrake.pm | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'perl-install/printer') diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index 7c9930950..e53442866 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -647,7 +647,9 @@ sub set_cups_autoconf { output($file, @file_content); # Restart CUPS - printer::services::restart("cups"); + if ($autoconf) { + printer::services::restart("cups"); + } return 1; } diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index 8bcf98951..a7273d13c 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -67,6 +67,7 @@ sub config_cups { # Read state for auto-correction of cupsd.conf $printer->{cupsconfig}{autocorrection} = printer::main::get_cups_autoconf(); + my $oldautocorr = $printer->{cupsconfig}{autocorrection}; # Human-readable strings for hosts onto which the local printers # are shared my $maindone; @@ -298,8 +299,11 @@ N("192.168.100.0/255.255.255.0\n") $retvalue = 1; $maindone = 1; # Write state for auto-correction of cupsd.conf - printer::main::set_cups_autoconf - ($printer->{cupsconfig}{autocorrection}); + if ($oldautocorr != + $printer->{cupsconfig}{autocorrection}) { + printer::main::set_cups_autoconf + ($printer->{cupsconfig}{autocorrection}); + } # Write cupsd.conf printer::main::write_cups_config($printer); printer::main::write_cupsd_conf -- cgit v1.2.1