File indexing completed on 2026-04-20 07:59:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 ARGV="$@"
0046
0047
0048
0049
0050
0051 HTTPD='/usr/sbin/httpd'
0052
0053
0054
0055
0056
0057 if [ -x /usr/bin/links ]; then
0058 LYNX="links -dump"
0059 elif [ -x /usr/bin/lynx ]; then
0060 LYNX="lynx -dump"
0061 else
0062 LYNX="none"
0063 fi
0064
0065
0066 VIRTUAL_ENV=/FIXME
0067 . ${VIRTUAL_ENV}/bin/activate
0068
0069
0070
0071
0072 STATUSURL="http://localhost:25080/server-status"
0073
0074
0075 if [ -r ${VIRTUAL_ENV}/etc/sysconfig/panda_harvester ]; then
0076 . ${VIRTUAL_ENV}/etc/sysconfig/panda_harvester
0077 fi
0078
0079 ERROR=0
0080 if [ "x$ARGV" = "x" ] ; then
0081 ARGV="-h"
0082 fi
0083
0084 function check13() {
0085
0086 GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
0087 GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
0088 GONE="${GONE}AccessConfig|ResourceConfig)"
0089 if grep -Eiq "^[[:space:]]*($GONE)" /etc/httpd/conf/httpd.conf; then
0090 echo "$0: Apache 1.3 configuration directives found"
0091 echo "$0: please read /usr/share/doc/httpd-2.0.52/migration.html"
0092 exit 2
0093 fi
0094 }
0095
0096 function checklynx() {
0097 if [ "$LYNX" = "none" ]; then
0098 echo "The 'links' package is required for this functionality."
0099 exit 8
0100 fi
0101 }
0102
0103 function testconfig() {
0104
0105
0106 if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled; then
0107 runcon -- `id -Z` $HTTPD $OPTIONS -t
0108 else
0109 $HTTPD $OPTIONS -t
0110 fi
0111 ERROR=$?
0112 }
0113
0114 function check_pidfile () {
0115 if [ -r ${VIRTUAL_ENV}/var/log/panda/panda_harvester_httpd.pid ]; then
0116 COMSTR=`echo $HTTPD $OPTIONS -k $ARGV`
0117 COMSTR=`echo $COMSTR | sed -e 's/ //g'`
0118 PSOUT=`ps -f -p \`cat ${VIRTUAL_ENV}/var/log/panda/panda_harvester_httpd.pid\` | cat | tail -1`
0119 PSOUT=`echo $PSOUT | sed -e 's/ //g'`
0120 if [ ! `echo $PSOUT | grep $COMSTR` ]; then
0121 echo "deleting pid"
0122 rm -rf ${VIRTUAL_ENV}/var/log/panda/panda_harvester_httpd.pid
0123 fi
0124 fi
0125 }
0126
0127 case $ARGV in
0128 restart|graceful)
0129 if $HTTPD -t >&/dev/null; then
0130 $HTTPD $OPTIONS -k $ARGV
0131 ERROR=$?
0132 else
0133 echo "apachectl: Configuration syntax error, will not run \"$ARGV\":"
0134 testconfig
0135 fi
0136 ;;
0137 start|stop)
0138 check13
0139 case $ARGV in
0140 start)
0141 check_pidfile
0142 esac
0143 $HTTPD $OPTIONS -k $ARGV
0144 ERROR=$?
0145 ;;
0146 startssl|sslstart|start-SSL)
0147 check13
0148 $HTTPD $OPTIONS -DSSL -k start
0149 ERROR=$?
0150 ;;
0151 configtest)
0152 testconfig
0153 ;;
0154 status)
0155 checklynx
0156 $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
0157 ;;
0158 fullstatus)
0159 checklynx
0160 $LYNX $STATUSURL
0161 ;;
0162 *)
0163 $HTTPD $OPTIONS $ARGV
0164 ERROR=$?
0165 esac
0166
0167 exit $ERROR
0168