Package: rcconf
Version: 3.1

when enabling or disabling multiple daemons, rcconf fails with all but one
of them.

The problem seems to lie in "$command" variable not being overwritten but
appended with each daemon, which results in the same command being run
repeatedly with new argumets added, see example from "rcconf -v":

/usr/sbin/update-rc.d courier-imap-ssl enable
/usr/sbin/update-rc.d courier-imap-ssl enable  /usr/sbin/update-rc.d 
courier-pop enable
update-rc.d: warning: enable action will have no effect on runlevel 
/usr/sbin/update-rc.d
update-rc.d: warning: enable action will have no effect on runlevel courier-pop
update-rc.d: warning: enable action will have no effect on runlevel enable
update-rc.d: error: no runlevel symlinks to modify, aborting!
/usr/sbin/update-rc.d courier-imap-ssl enable  /usr/sbin/update-rc.d 
courier-pop enable  /usr/sbin/update-rc.d courier-pop-ssl enable
update-rc.d: warning: enable action will have no effect on runlevel 
/usr/sbin/update-rc.d
update-rc.d: warning: enable action will have no effect on runlevel courier-pop
update-rc.d: warning: enable action will have no effect on runlevel enable
update-rc.d: warning: enable action will have no effect on runlevel 
/usr/sbin/update-rc.d
update-rc.d: warning: enable action will have no effect on runlevel 
courier-pop-ssl
update-rc.d: warning: enable action will have no effect on runlevel enable
update-rc.d: error: no runlevel symlinks to modify, aborting!

the patch that fixed the behaviour attached.

--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Fighting for peace is like fucking for virginity...
--- rcconf	2013-10-26 03:10:57.000000000 +0200
+++ rcconf.fixed	2016-10-12 15:31:17.939272822 +0200
@@ -1079,7 +1079,7 @@
     if ( ( exists($data->{$key}) ) &&
          ( $data->{$key}->{'start'} eq "z" ) &&
          ( $data->{$key}->{'stop'} eq "z" ) ) {
-      $command .= $UPDATE_RCD_PATH . " " . $key . " enable ";
+      $command = $UPDATE_RCD_PATH . " " . $key . " enable ";
     } else {
       $command = $UPDATE_RCD_PATH." -f ".$key." remove $DEBUG_STRING ";
       if ( ( exists($data->{$key}) ) &&
@@ -1129,7 +1129,7 @@
         $pn = "00";
     }
     if ( $data->{$key}->{'stop'} eq "z" ) {
-      $command .= $UPDATE_RCD_PATH . " " . $key . " disable $DEBUG_STRING ";
+      $command = $UPDATE_RCD_PATH . " " . $key . " disable $DEBUG_STRING ";
     } else {
       $command = $UPDATE_RCD_PATH." -f ".$key." remove $DEBUG_STRING ";
       if ( $pn ne "" ) {

Reply via email to