mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Remove support for ancient caldera-only daemons_dir feature
This commit is contained in:
@@ -12,10 +12,6 @@ if ($config{'init_base'}) {
|
||||
local @ac = split(/\s+/, $a);
|
||||
push(@rv, $ac[0] =~ /^\// ? $ac[0]
|
||||
: "$config{'init_dir'}/$ac[0]");
|
||||
if ($config{'daemons_dir'} &&
|
||||
-r "$config{'daemons_dir'}/$ac[0]") {
|
||||
push(@rv, "$config{'daemons_dir'}/$ac[0]");
|
||||
}
|
||||
local $ufile = "/etc/init/$ac[0]";
|
||||
if (-r $ufile) {
|
||||
push(@rv, $ufile);
|
||||
|
||||
@@ -104,10 +104,6 @@ elsif (!$config{'expert'} || $access{'bootup'} == 2) {
|
||||
local ($l, $p) = split(/\s+/, $s);
|
||||
$boot = 1 if (&indexof($l, @boot) >= 0);
|
||||
}
|
||||
if ($boot && $config{'daemons_dir'} &&
|
||||
&read_env_file("$config{'daemons_dir'}/$ac", \%daemon)) {
|
||||
$boot = lc($daemon{'ONBOOT'}) eq 'yes' ? 1 : 0;
|
||||
}
|
||||
print &ui_hidden("oldboot", $boot);
|
||||
}
|
||||
if ($access{'bootup'} == 1) {
|
||||
@@ -136,13 +132,6 @@ elsif (!$config{'expert'} || $access{'bootup'} == 2) {
|
||||
print &ui_table_end();
|
||||
}
|
||||
else {
|
||||
if ($config{'daemons_dir'} && $ac &&
|
||||
&read_env_file("$config{'daemons_dir'}/$ac", \%daemon)) {
|
||||
# Display onboot flag from daemons file
|
||||
$boot = lc($daemon{'ONBOOT'}) eq 'yes';
|
||||
print &ui_table_row($text{'edit_boot'},
|
||||
&ui_yesno_radio("boot", $boot ? 1 : 0));
|
||||
}
|
||||
print &ui_table_end();
|
||||
|
||||
# Display which runlevels the action is started/stopped in
|
||||
|
||||
@@ -66,12 +66,6 @@ elsif ($init_mode eq "init" && $access{'bootup'}) {
|
||||
foreach $s (&action_levels('S', $acts[$i])) {
|
||||
local ($l, $p) = split(/\s+/, $s);
|
||||
local ($lvl) = (&indexof($l, @boot) >= 0);
|
||||
local %daemon;
|
||||
if ($lvl && $config{'daemons_dir'} &&
|
||||
&read_env_file("$config{'daemons_dir'}/$acts[$i]",
|
||||
\%daemon)) {
|
||||
$lvl = lc($daemon{'ONBOOT'}) eq 'yes' ? 1 : 0;
|
||||
}
|
||||
push(@{$actsb[$i]}, [ $l, $p, $lvl ]);
|
||||
}
|
||||
@{$actsb[$i]} = sort { $b->[2] <=> $a->[2] } @{$actsb[$i]};
|
||||
|
||||
@@ -438,15 +438,6 @@ if ($_[1]) {
|
||||
}
|
||||
|
||||
my $desc;
|
||||
if ($config{'daemons_dir'}) {
|
||||
# First try the daemons file
|
||||
my %daemon;
|
||||
if ($_[0] =~ /\/([^\/]+)$/ &&
|
||||
&read_env_file("$config{'daemons_dir'}/$1", \%daemon) &&
|
||||
$daemon{'DESCRIPTIVE'}) {
|
||||
return $daemon{'DESCRIPTIVE'};
|
||||
}
|
||||
}
|
||||
if ($config{'chkconfig'}) {
|
||||
# Find the redhat-style description: section
|
||||
foreach (@lines) {
|
||||
@@ -575,10 +566,6 @@ if ($init_mode eq "init" || $init_mode eq "upstart" ||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($starting && $config{'daemons_dir'} &&
|
||||
&read_env_file("$config{'daemons_dir'}/$name", \%daemon)) {
|
||||
$starting = lc($daemon{'ONBOOT'}) eq 'yes' ? 1 : 0;
|
||||
}
|
||||
return !$exists ? 0 : $starting ? 2 : 1;
|
||||
}
|
||||
elsif ($init_mode eq "local") {
|
||||
@@ -715,10 +702,6 @@ if ($init_mode eq "systemd" && (!-r "$config{'init_dir'}/$action" ||
|
||||
if ($init_mode eq "init" || $init_mode eq "local" || $init_mode eq "upstart" ||
|
||||
$init_mode eq "systemd") {
|
||||
# In these modes, we create a script to run
|
||||
if ($config{'daemons_dir'} &&
|
||||
&read_env_file("$config{'daemons_dir'}/$action", \%daemon)) {
|
||||
$daemon++;
|
||||
}
|
||||
my $fn;
|
||||
if ($init_mode eq "init" || $init_mode eq "upstart" ||
|
||||
$init_mode eq "systemd") {
|
||||
@@ -740,14 +723,7 @@ if ($init_mode eq "init" || $init_mode eq "local" || $init_mode eq "upstart" ||
|
||||
}
|
||||
|
||||
my $need_links = 0;
|
||||
if ($st == 1 && $daemon) {
|
||||
# Just update daemons file
|
||||
$daemon{'ONBOOT'} = 'yes';
|
||||
&lock_file("$config{'daemons_dir'}/$action");
|
||||
&write_env_file("$config{'daemons_dir'}/$action", \%daemon);
|
||||
&unlock_file("$config{'daemons_dir'}/$action");
|
||||
}
|
||||
elsif ($st == 1) {
|
||||
if ($st == 1) {
|
||||
# Just need to create links (later)
|
||||
$need_links++;
|
||||
}
|
||||
@@ -1106,19 +1082,10 @@ elsif ($init_mode eq "systemd") {
|
||||
if ($init_mode eq "init" || $init_mode eq "upstart" ||
|
||||
$init_mode eq "systemd") {
|
||||
# Unlink or disable init script
|
||||
my ($daemon, %daemon);
|
||||
my $file = &action_filename($_[0]);
|
||||
my @chk = &chkconfig_info($file);
|
||||
my $data = &read_file_contents($file);
|
||||
|
||||
if ($config{'daemons_dir'} &&
|
||||
&read_env_file("$config{'daemons_dir'}/$_[0]", \%daemon)) {
|
||||
# Update daemons file
|
||||
$daemon{'ONBOOT'} = 'no';
|
||||
&lock_file("$config{'daemons_dir'}/$_[0]");
|
||||
&write_env_file("$config{'daemons_dir'}/$_[0]", \%daemon);
|
||||
&unlock_file("$config{'daemons_dir'}/$_[0]");
|
||||
}
|
||||
elsif (&has_command("chkconfig") && !$config{'no_chkconfig'} && @chk) {
|
||||
# Call chkconfig to remove the links
|
||||
&system_logged("chkconfig ".quotemeta($_[0])." off");
|
||||
|
||||
@@ -55,7 +55,6 @@ foreach $rl (&list_runlevels()) {
|
||||
|
||||
if ($in{'old'} && $in{'type'} == 0) {
|
||||
# Changing a 'sane' action
|
||||
local $dd = $config{'daemons_dir'};
|
||||
$in{data} =~ s/\r//g;
|
||||
if ($in{old} ne $in{name}) {
|
||||
# Need to rename the action..
|
||||
@@ -63,15 +62,6 @@ if ($in{'old'} && $in{'type'} == 0) {
|
||||
&error(&text('save_ealready', $in{name}));
|
||||
}
|
||||
&rename_action($in{old}, $in{name});
|
||||
if ($dd) {
|
||||
# Need to rename the caldera daemons file too
|
||||
&rename_logged("$dd/$in{old}", "$dd/$in{name}");
|
||||
&lock_file("$dd/$in{'name'}");
|
||||
&read_env_file("$dd/$in{name}", \%daemon);
|
||||
$daemon{'IDENT'} = $in{'name'}
|
||||
if ($daemon{'IDENT'} eq $in{'old'});
|
||||
&write_env_file("$dd/$in{name}", \%daemon);
|
||||
}
|
||||
}
|
||||
&lock_file("$dd/$in{'name'}") if ($dd);
|
||||
$file = &action_filename($in{name});
|
||||
@@ -110,13 +100,6 @@ if ($in{'old'} && $in{'type'} == 0) {
|
||||
'K',$in{"pri_K$rl"});
|
||||
}
|
||||
}
|
||||
|
||||
if (defined($in{'boot'}) && $dd) {
|
||||
# Update onboot flag in daemons file
|
||||
&read_env_file("$dd/$in{'name'}", \%daemon);
|
||||
$daemon{'ONBOOT'} = $in{'boot'} ? 'yes' : 'no';
|
||||
&write_env_file("$dd/$in{'name'}", \%daemon);
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Just change whether it gets started or not
|
||||
|
||||
Reference in New Issue
Block a user