/ my $sysvrcconf_bin = '/usr/sbin/sysv-rc-conf'; exit if (! -x $sysvrcconf_bin); my @services = ('apache2','loncontrol'); my @runlevels = qw/3 4 5/; my $rlstr = join('',@runlevels); foreach my $service (@services) { my $command = $sysvrconf_bin' --list '.$service; my $results = `$command`; if ($results eq '') { print "**** WARNING: $service is not set to run on boot.$/". " Execute the following commands to fix this:".$/. " $sysvrcconf_bin --level $rlstr $service on".$/; } else { my %curr_runlevels; for (my $rl = 0;$rl <=6;$rl++) { if ($results =~ /$rl:on/) { $curr_runlevels{$rl}++; } } # my $warning; foreach my $rl (@runlevels) { if (! exists($curr_runlevels{$rl}) ) { $warning .= "**** WARNING: $service is not set to run at runlevel $rl".$/; } } if ($warning) { print $warning. " Execute the following command to fix this:".$/. " $sysvrcconf_bin --level $rlstr $service on".$/; } } }