Enable use of LSB init script headers on Debian
authorJamie Cameron <jcameron@webmin.com>
Tue, 22 Feb 2011 19:29:57 +0000 (11:29 -0800)
committerJamie Cameron <jcameron@webmin.com>
Tue, 22 Feb 2011 19:29:57 +0000 (11:29 -0800)
https://www.virtualmin.com/node/17287

init/config-debian-linux
init/init-lib.pl

index fea51c3..fdc78f4 100644 (file)
@@ -13,3 +13,4 @@ order=0
 sort_mode=0
 boot_levels=2 3 5
 no_chkconfig=0
+init_info=1
index 48299cd..8ce6ba9 100755 (executable)
@@ -419,15 +419,6 @@ if ($config{'chkconfig'}) {
                        }
                }
        }
-elsif ($config{'init_info'} || $data =~ /BEGIN INIT INFO/) {
-       # Find the suse-style Description: line
-       foreach (@lines) {
-               s/\r|\n//g;
-               if (/^#\s*(Description|Short-Description):\s*(.*)/) {
-                       $desc = $2;
-                       }
-               }
-       }
 elsif ($_[0] =~ /^\/etc\/init.d\/(\S+)$/ && -r "/etc/init/$1.conf") {
        # Upstart description file exists
        open(CONF, "/etc/init/$1.conf");
@@ -439,6 +430,15 @@ elsif ($_[0] =~ /^\/etc\/init.d\/(\S+)$/ && -r "/etc/init/$1.conf") {
                }
        close(CONF);
        }
+elsif ($config{'init_info'} || $data =~ /BEGIN INIT INFO/) {
+       # Find the suse-style Description: line
+       foreach (@lines) {
+               s/\r|\n//g;
+               if (/^#\s*(Description|Short-Description):\s*(.*)/) {
+                       $desc = $2;
+                       }
+               }
+       }
 else {
        # Use the first comments
        foreach (@lines) {