Annotation of doc/loncapafiles/chkconfig.piml, revision 1.1

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

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