/ /home/httpd/lonUsers my $chkconfig_bin = '/sbin/chkconfig'; exit if (! -x $chkconfig_bin); my $command = $chkconfig_bin.' --list httpd'; my $results = `$command`; if ($results eq '') { print "**** WARNING: httpd is not set to run on boot.$/". " Execute the following commands to fix this:".$/. " $chkconfig_bin --add httpd".$/. " $chkconfig_bin httpd on".$/; } else { my %httpd_runlevels; for (my $rl = 0;$rl <=6;$rl++) { if ($results =~ /$rl:on/) { $httpd_runlevels{$rl}++; } } # my $warning; foreach my $rl (qw/3 4 5/) { if (! exists($httpd_runlevels{$rl}) ) { $warning .= "**** WARNING: httpd is not set to run at runlevel $rl".$/; } } if ($warning) { print $warning. " Execute the following command to fix this:".$/. " /sbin/chkconfig httpd 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 (qw/3 4 5/) { 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 ".$/; } }