$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("");
$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]");
}
=cut
sub init_description
{
+# Read contents of script, extract start/stop commands
open(FILE, $_[0]);
local @lines = <FILE>;
close(FILE);
}
}
}
+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) {