Annotation of doc/loncapafiles/sysv-rc-conf.piml, revision 1.1

1.1     ! raeburn     1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
        !             2: 	"http://lpml.sourceforge.net/DTD/piml.dtd">
        !             3: <!-- Stuart Raeburn -->
        !             4: 
        !             5: <!-- $Id: sysv-rc-conf.piml,v 1.7 2009/07/05 21:23:42 raeburn Exp $ -->
        !             6: 
        !             7: <!--
        !             8: 
        !             9: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
        !            10: 
        !            11: LON-CAPA is free software; you can redistribute it and/or modify
        !            12: it under the terms of the GNU General Public License as published by
        !            13: the Free Software Foundation; either version 2 of the License, or
        !            14: (at your option) any later version.
        !            15: 
        !            16: LON-CAPA is distributed in the hope that it will be useful,
        !            17: but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            19: GNU General Public License for more details.
        !            20: 
        !            21: You should have received a copy of the GNU General Public License
        !            22: along with LON-CAPA; if not, write to the Free Software
        !            23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        !            24: 
        !            25: /home/httpd/html/adm/gpl.txt
        !            26: 
        !            27: http://www.lon-capa.org/
        !            28: 
        !            29: -->
        !            30: 
        !            31: <piml>
        !            32: <targetroot>/</targetroot>
        !            33: <files>
        !            34: <file>
        !            35: <target dist='default'></target>
        !            36: <perlscript mode="fg">
        !            37: my $sysvrcconf_bin = '/usr/sbin/sysv-rc-conf';
        !            38: exit if (! -x $sysvrcconf_bin);
        !            39: 
        !            40: my @services = ('apache2','loncontrol');
        !            41: my @runlevels = qw/3 4 5/;
        !            42: my $rlstr = join('',@runlevels);
        !            43: foreach my $service (@services) {
        !            44:     my $command = $sysvrconf_bin' --list '.$service;
        !            45:     my $results = `$command`;
        !            46:     if ($results eq '') {
        !            47:         print "**** WARNING: $service is not set to run on boot.$/".
        !            48:         "    Execute the following commands to fix this:".$/.
        !            49:         "        $sysvrcconf_bin --level $rlstr $service on".$/;
        !            50:     } else {
        !            51:         my %curr_runlevels;
        !            52:         for (my $rl = 0;$rl &lt;=6;$rl++) {
        !            53:            if ($results =~ /$rl:on/) { $curr_runlevels{$rl}++; }
        !            54:         }
        !            55:         #
        !            56:         my $warning;
        !            57:         foreach my $rl (@runlevels) {
        !            58:             if (! exists($curr_runlevels{$rl}) ) {
        !            59:                 $warning .= 
        !            60:                    "**** WARNING: $service is not set to run at runlevel $rl".$/;
        !            61:             }
        !            62:         }
        !            63:         if ($warning) {
        !            64:             print $warning.
        !            65:                   "    Execute the following command to fix this:".$/.
        !            66:                   "        $sysvrcconf_bin --level $rlstr $service on".$/;
        !            67:         }
        !            68:     }
        !            69: }
        !            70: 
        !            71: </perlscript>
        !            72: </file>
        !            73: </files>
        !            74: </piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>