Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:39:08

0001 #!/bin/sh
0002 #
0003 # chkconfig: - 85 15
0004 #
0005 # description: Panda server service, controlling both httpd and daemon
0006 
0007 # When multiple arguments are given, only the error from the _last_
0008 # one is reported.
0009 #
0010 ARGV="$@"
0011 #
0012 # |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||
0013 # --------------------                              --------------------
0014 #
0015 
0016 # path to init.d scripts
0017 S_httpd='@@virtual_env@@/etc/rc.d/init.d/panda_httpd'
0018 S_daemon='@@virtual_env@@/etc/rc.d/init.d/panda_daemon'
0019 
0020 
0021 if [ "x$ARGV" = "x" ] ; then
0022     ARGV="-h"
0023 fi
0024 
0025 
0026 case $ARGV in
0027 start)
0028     ${S_daemon} start
0029     ERROR=$?
0030     if [ $ERROR -ne 0 ]; then
0031       exit $ERROR
0032     fi
0033     { ${S_httpd} start 2>&1; echo ERROR=$? > /tmp/panda_server_err; } | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]",systime(),1), $0 }' |& tee /tmp/panda_server_start.log
0034     . /tmp/panda_server_err
0035     rm -rf /tmp/panda_server_err
0036     ;;
0037 stop)
0038     ${S_daemon} stop
0039     ERROR1=$?
0040     { ${S_httpd} stop 2>&1; echo ERROR2=$? > /tmp/panda_server_err; } | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]",systime(),1), $0 }' |& tee /tmp/panda_server_stop.log
0041     . /tmp/panda_server_err
0042     rm -rf /tmp/panda_server_err
0043     if [ $ERROR2 -eq 0 ]; then
0044       ERROR=$ERROR1
0045     else
0046       ERROR=$ERROR2
0047     fi
0048     ;;
0049 start-httpd)
0050     ${S_httpd} start
0051     ERROR=$?
0052     ;;
0053 stop-httpd)
0054     ${S_httpd} stop
0055     ERROR=$?
0056     ;;
0057 start-daemon)
0058     ${S_daemon} start
0059     ERROR=$?
0060     ;;
0061 stop-daemon)
0062     ${S_daemon} stop
0063     ERROR=$?
0064     ;;
0065 *)
0066     echo "ERROR: unknown command $ARGV"
0067     ERROR=1
0068 esac
0069 
0070 exit $ERROR