mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Changes to support upstart and ubuntu 10.10
This commit is contained in:
@@ -23,6 +23,10 @@ elsif ($in{type} == 1) {
|
||||
$file = &runlevel_filename($in{runlevel}, $in{startstop},
|
||||
$in{number}, $in{action});
|
||||
}
|
||||
if (&has_command("insserv")) {
|
||||
&system_logged("insserv -r ".quotemeta($in{action}));
|
||||
}
|
||||
&unlink_logged("/etc/init/$in{'action'}.conf");
|
||||
&unlink_logged($file);
|
||||
&webmin_log('delete', 'action', $in{'action'});
|
||||
&redirect("");
|
||||
|
||||
@@ -112,7 +112,7 @@ foreach $f (sort { lc($a) cmp lc($b) } readdir(DIR)) {
|
||||
$f eq "core" || $f eq "README" || $f eq "rc" || $f eq "rcS" ||
|
||||
-d "$dir/$f" || $f =~ /\.swp$/ || $f eq "skeleton" ||
|
||||
$f =~ /\.lock$/ || $f =~ /\.dpkg-(old|dist)$/ ||
|
||||
$f =~ /^\.depend\./) { next; }
|
||||
$f =~ /^\.depend\./ || $f eq '.legacy-bootordering') { next; }
|
||||
if (@stbuf = stat("$dir/$f")) {
|
||||
push(@rv, "$f $stbuf[1]");
|
||||
}
|
||||
@@ -381,6 +381,7 @@ in with supported parameters to the action, like 'start' and 'stop'.
|
||||
=cut
|
||||
sub init_description
|
||||
{
|
||||
# Read contents of script, extract start/stop commands
|
||||
open(FILE, $_[0]);
|
||||
local @lines = <FILE>;
|
||||
close(FILE);
|
||||
@@ -427,6 +428,17 @@ elsif ($config{'init_info'} || $data =~ /BEGIN INIT INFO/) {
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($_[0] =~ /^\/etc\/init.d\/(\S+)$/ && -r "/etc/init/$1.conf") {
|
||||
# Upstart description file exists
|
||||
open(CONF, "/etc/init/$1.conf");
|
||||
while(<CONF>) {
|
||||
if (/^description\s+"([^"]+)"/) {
|
||||
$desc = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(CONF);
|
||||
}
|
||||
else {
|
||||
# Use the first comments
|
||||
foreach (@lines) {
|
||||
|
||||
Reference in New Issue
Block a user