blob: 4212917f6e010d230bd51aabb953a0a6603ad0be [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001# Hack in support for an "exclude" config option for the init module, so
2# we can hide certain system services that shouldn't really be configurable
3# via the web interface
4#
5# Upstream-status: Pending
6#
7# Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8# Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 init/index.cgi | 27 ++++++++++++++-------------
11 init/init-lib.pl | 5 +++--
12 2 files changed, 17 insertions(+), 15 deletions(-)
13
Brad Bishop316dfdd2018-06-25 12:45:53 -040014Index: webmin-1.850/init/index.cgi
15===================================================================
16--- webmin-1.850.orig/init/index.cgi
17+++ webmin-1.850/init/index.cgi
18@@ -45,19 +45,20 @@ elsif ($init_mode eq "init" && $access{'
Patrick Williamsb48b7b42016-08-17 15:04:38 -050019 : "$config{'init_dir'}/$ac[0]");
20 }
21 @runlevels = &list_runlevels();
22- foreach $r (@runlevels) {
23- foreach $w ("S", "K") {
24- foreach $a (&runlevel_actions($r, $w)) {
25- @ac = split(/\s+/, $a);
26- if (!$nodemap{$ac[2]}) {
27- push(@acts, $ac[1]);
28- push(@actsl,
29- "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
30- push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
31- }
32- }
33- }
34- }
35+ # Assume there won't be any of these broken actions
36+ #foreach $r (@runlevels) {
37+ # foreach $w ("S", "K") {
38+ # foreach $a (&runlevel_actions($r, $w)) {
39+ # @ac = split(/\s+/, $a);
40+ # if (!$nodemap{$ac[2]}) {
41+ # push(@acts, $ac[1]);
42+ # push(@actsl,
43+ # "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
44+ # push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
45+ # }
46+ # }
47+ # }
48+ # }
49
50 # For each action, look at /etc/rc*.d/* files to see if it is
51 # started at boot
Brad Bishop316dfdd2018-06-25 12:45:53 -040052Index: webmin-1.850/init/init-lib.pl
53===================================================================
54--- webmin-1.850.orig/init/init-lib.pl
55+++ webmin-1.850/init/init-lib.pl
56@@ -124,8 +124,9 @@ List boot time action names from init.d,
Patrick Williamsb48b7b42016-08-17 15:04:38 -050057 =cut
58 sub list_actions
59 {
60-local($dir, $f, @stbuf, @rv);
61+local($dir, $f, @stbuf, @rv, @exclude);
62 $dir = $config{init_dir};
63+@exclude = split(/,/, $config{exclude});
64 opendir(DIR, $dir);
65 foreach $f (sort { lc($a) cmp lc($b) } readdir(DIR)) {
66 if ($f eq "." || $f eq ".." || $f =~ /\.bak$/ || $f eq "functions" ||
Brad Bishop316dfdd2018-06-25 12:45:53 -040067@@ -133,7 +134,7 @@ foreach $f (sort { lc($a) cmp lc($b) } r
Patrick Williamsb48b7b42016-08-17 15:04:38 -050068 -d "$dir/$f" || $f =~ /\.swp$/ || $f eq "skeleton" ||
69 $f =~ /\.lock$/ || $f =~ /\.dpkg-(old|dist)$/ ||
70 $f =~ /^\.depend\./ || $f eq '.legacy-bootordering' ||
71- $f =~ /^mandrake/) { next; }
72+ $f =~ /^mandrake/ || grep {$_ eq $f} @exclude ) { next; }
73 if (@stbuf = stat("$dir/$f")) {
74 push(@rv, "$f $stbuf[1]");
75 }