/ /home/httpd/lonUsers my $chkconfig_bin = '/sbin/chkconfig'; exit if (! -x $chkconfig_bin); my $webserver = 'httpd'; my @runlevels = qw/3 4 5/; if ('' eq 'suse9.3' || '' eq 'suse9.2' || '' eq 'sles9') { $webserver = 'apache'; @runlevels = qw/3 5/; } elsif ('' eq 'sles10') { $webserver = 'apache2'; } my $command = $chkconfig_bin.' --list '.$webserver; my $results = `$command`; if ($results eq '') { print "**** WARNING: $webserver is not set to run on boot.$/". " Execute the following commands to fix this:".$/. " $chkconfig_bin --add $webserver".$/. " $chkconfig_bin $webserver on".$/; } else { my %httpd_runlevels; for (my $rl = 0;$rl <=6;$rl++) { if ($results =~ /$rl:on/) { $httpd_runlevels{$rl}++; } } # my $warning; foreach my $rl (@runlevels) { if (! exists($httpd_runlevels{$rl}) ) { $warning .= "**** WARNING: $webserver is not set to run at runlevel $rl".$/; } } if ($warning) { print $warning. " Execute the following command to fix this:".$/. " /sbin/chkconfig $webserver on ".$/; } } $command = $chkconfig_bin.' --list loncontrol'; $results = `$command`; if ($results eq '') { print "**** WARNING: loncontrol is not set to run on boot.$/". " Execute the following commands to fix this:".$/. " $chkconfig_bin --add loncontrol".$/. " $chkconfig_bin loncontrol on".$/; } else { my %loncontrol_runlevels; for (my $rl = 0;$rl<=6;$rl++) { if ($results =~ /$rl:on/) { $loncontrol_runlevels{$rl}++; } } # $warning = ''; foreach my $rl (@runlevels) { if (! exists($loncontrol_runlevels{$rl})) { $warning .= "**** WARNING: loncontrol is not set to run at runlevel $rl\n"; } } if ($warning) { print $warning. " Execute the following command to fix this:".$/. " /sbin/chkconfig loncontrol on ".$/; } }