# cat /etc/rc.d/init.d/lcserver #!/bin/sh # # Startup script for the Apache Web Server # # chkconfig: 345 85 15 # description: Apache is a World Wide Web server. It is used to serve \ # HTML files and CGI. # processname: lcserver # pidfile: /var/run/httpd.pid # config: /usr/local/hde/lcserver/conf/access.conf # config: /usr/local/hde/lcserver/conf/httpd.conf # config: /usr/local/hde/lcserver/conf/srm.conf # Configure lcserver to use the correct /etc/passwd file. CONF="/usr/local/hde/lcserver/conf/lcserver.conf"; CONFBAK="/usr/local/hde/lcserver/conf/lcserver.conf.backup"; CONFTMP="/usr/local/hde/lcserver/conf/lcserver.conf.tmp"; if [ $# -gt 1 ] && [ "status" != $1 ]; then if [ -e /etc/shadow ]; then sed -e 's/AuthUserFile .*/AuthUserFile \/etc\/shadow/' < $CONF > $CONFTMP else sed -e 's/AuthUserFile .*/AuthUserFile \/etc\/passwd/' < $CONF > $CONFTMP fi if [ -s $CONFTMP ]; then cp $CONFTMP $CONF rm $CONFTMP fi # Configure lcserver to use IP address as it's ServerName # Get the gateway device IP address # If we can't get it, use 'localhost'. if [ -r /etc/sysconfig/network ]; then . /etc/sysconfig/network fi fi # if status # Source function library. . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting lcserver: " export HOSTRESORDER=local daemon /usr/local/hde/lcserver/bin/lcserver echo touch /var/lock/subsys/lcserver ;; stop) echo -n "Shutting down lcserver: " killproc lcserver echo rm -f /var/lock/subsys/lcserver rm -f /var/run/lcserver.pid ;; status) status lcserver ;; restart) $0 stop sleep 3; $0 start ;; reload) echo -n "Reloading lcserver: " [ -f /var/run/lcserver.pid ] && { kill -HUP `cat /var/run/lcserver.pid` echo -n lcserver } echo ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit 0 #