Changeset 24

Show
Ignore:
Timestamp:
02/19/2005 03:55:47 PM (4 years ago)
Author:
jan
Message:

applied init.d patches for FC3 from Matthias Saou

  • Add "$" to get strings translated
  • Cleanup to look more like RH/FC init scripts
  • Change S to 85 and K to 15, like apache
  • Remove "on" from all runlevels by default
  • Add "condrestart" support.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/rc.lighttpd.redhat

    r1 r24  
    1 #! /bin/sh 
    2  
    3 # lighttpd init file for redhat 
     1#!/bin/sh 
    42# 
    5 # Tue Apr 9 2004 Matthijs van der Klip 
     3# lighttpd     Startup script for the lighttpd server 
    64# 
    7 # chkconfig: 2345 99 01 
    8 # description: Jan Kneschke's lighttpd 
     5# chkconfig: - 85 15 
     6# description: Lightning fast webserver with light system requirements 
    97# 
    10 # processname: /usr/sbin/lighttpd 
     8# processname: lighttpd 
    119# config: /etc/lighttpd/lighttpd.conf 
    1210# config: /etc/sysconfig/lighttpd 
     
    1614# by lighttpd (config: server.pid-file). 
    1715# If not, uncomment 'pidof' line. 
    18 # 
    19 # source function library 
    20 . /etc/init.d/functions 
    2116 
     17# Source function library 
     18. /etc/rc.d/init.d/functions 
     19 
     20if [ -f /etc/sysconfig/lighttpd ]; then 
     21        . /etc/sysconfig/lighttpd 
     22fi 
     23 
     24if [ -z "$LIGHTTPD_CONF_PATH" ]; then 
     25        LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf" 
     26fi 
     27 
     28prog="lighttpd" 
     29lighttpd="/usr/sbin/lighttpd" 
    2230RETVAL=0 
    23 prog="lighttpd" 
    24 pidfile="/var/run/lighttpd.pid" 
    25 LIGHTTPD_BIN=/usr/sbin/lighttpd 
    26 LIGHTTPD_CONFIG=/etc/sysconfig/lighttpd 
    27 . $LIGHTTPD_CONFIG 
    2831 
    2932start() { 
    30         echo -n "Starting $prog: " 
    31         daemon $LIGHTTPD_BIN -f $LIGHTTPD_CONF_PATH 
     33        echo -n $"Starting $prog: " 
     34        daemon $lighttpd -f $LIGHTTPD_CONF_PATH 
    3235        RETVAL=$? 
    3336        echo 
    34         touch /var/lock/subsys/$prog 
    35         #pidof $prog > $pidfile 
     37        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog 
    3638        return $RETVAL 
    3739} 
    3840 
    3941stop() { 
    40         echo -n "Stopping $prog: " 
    41         killproc $LIGHTTPD_BIN 
     42        echo -n $"Stopping $prog: " 
     43        killproc $lighttpd 
    4244        RETVAL=$? 
    4345        echo 
    44         rm -f /var/lock/subsys/$prog 
     46        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog 
    4547        return $RETVAL 
    4648} 
    4749 
    4850reload() { 
    49         echo -n "Reloading $prog: " 
    50         killproc $LIGHTTPD_BIN -HUP 
     51        echo -n $"Reloading $prog: " 
     52        killproc $lighttpd -HUP 
    5153        RETVAL=$? 
    5254        echo 
     
    6567                start 
    6668                ;; 
     69        condrestart) 
     70                if [ -f /var/lock/subsys/$prog ]; then 
     71                        stop 
     72                        start 
     73                fi 
     74                ;; 
    6775        reload) 
    6876                reload 
    6977                ;; 
    7078        status) 
    71                 status $prog 
     79                status $lighttpd 
    7280                RETVAL=$? 
    7381                ;; 
    7482        *) 
    75                 echo $"Usage: $0 {start|stop|restart|reload|status}" 
     83                echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}" 
    7684                RETVAL=1 
    7785esac