Enable use of LSB init script headers on Debian

https://www.virtualmin.com/node/17287
This commit is contained in:
Jamie Cameron
2011-02-22 11:29:57 -08:00
parent 21dfa5dd58
commit 6ab42dfd4e
2 changed files with 10 additions and 9 deletions

View File

@@ -13,3 +13,4 @@ order=0
sort_mode=0
boot_levels=2 3 5
no_chkconfig=0
init_info=1

View File

@@ -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) {