From 6ab42dfd4e86930f70569092e650e6fe628e736b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 22 Feb 2011 11:29:57 -0800 Subject: [PATCH] Enable use of LSB init script headers on Debian https://www.virtualmin.com/node/17287 --- init/config-debian-linux | 1 + init/init-lib.pl | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/init/config-debian-linux b/init/config-debian-linux index fea51c31b..fdc78f4f5 100644 --- a/init/config-debian-linux +++ b/init/config-debian-linux @@ -13,3 +13,4 @@ order=0 sort_mode=0 boot_levels=2 3 5 no_chkconfig=0 +init_info=1 diff --git a/init/init-lib.pl b/init/init-lib.pl index 48299cda0..8ce6ba979 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -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) {