The reason this is a problem is that identd (at least openbsd-identd) is "smart", and doesn't start itself when no services are defined in /etc/inetd.conf. Then when a new service (such as pidentd) is installed, update-identd attempts a force-reload or a restart; neither of which will start a service that isn't running.

This patch attempts to detect if there are any services enabled before an enable/add action is performed, and if not, it issues a 'start' rather than a restart/force-reload to wake up inetd.


--- orig/update-inetd-4.31/DebianNet.pm    2008-02-04 09:27:20.000000000 -0600
+++ update-inetd-4.31/DebianNet.pm    2009-02-26 11:59:43.000000000 -0600
@@ -91,6 +91,7 @@
            }
        }
        if ($inetdconf) {
+            my $init_svc_count = &scan_entries();
            open(ICWRITE, ">$inetdcf.new") || die "Error creating new $inetdcf: 
$!\n";
            open(ICREAD, "$inetdcf");
            while(<ICREAD>) {
@@ -115,7 +116,7 @@
                die "Error installing new $inetdcf: $!\n";
            chmod(0644, "$inetdcf");

-            &wakeup_inetd;
+            &wakeup_inetd(0,$init_svc_count);
        }
    }

@@ -211,6 +212,7 @@
    my($service, $pattern) = @_;
    unless (defined($service)) { return(-1) };
    unless (defined($pattern)) { $pattern = ''; }
+    my $init_svc_count = &scan_entries();
    chomp($service);
    open(ICWRITE, ">$inetdcf.new") || die "Error creating new $inetdcf: $!\n";
    open(ICREAD, "$inetdcf");
@@ -229,17 +231,19 @@
        die "Error installing new $inetdcf: $!\n";
    chmod(0644, "$inetdcf");

-    &wakeup_inetd;
+    &wakeup_inetd(0,$init_svc_count);
    return(1);
}

sub wakeup_inetd {
-    my($removal) = @_;
+    my($removal,$init_svc_count) = @_;
    my($pid);
    my($action);

    if ($removal) {
        $action = 'force-reload';
+    } elsif ( defined($init_svc_count) and $init_svc_count == 0 ) {
+        $action = 'start';
    } else {
        $action = 'restart';
    }
@@ -264,6 +268,7 @@

sub scan_entries {
    my ($service, $pattern) = @_;
+    unless (defined($service)) { $service = '[^#\s]'; }
    unless (defined($pattern)) { $pattern = ''; }
    my $counter = 0;






--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to