[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fichier de démarrage



Salut, j'ai pas les scripts de démarrage de qmail et openldap, mais
voici déjà ceux de squid et de apache.

youri

NDSoftware wrote:
> 
> Bonjour,
> 
> Qui peut m'envoyer les fichiers de démarrage suivant (dans /etc/init.d)
> 
> apache
> qmail
> openldap
> squid
> 
> Merci
> 
> --
> To UNSUBSCRIBE, email to debian-french-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
Youri Albinovanus - System Administrator
Tiscali Belgium
29 - 31 ch. d'Ixelles - Tel. : +32 2 4000888
1050 BRUXELLES -	Fax. : +32 2 4000899
#! /bin/sh
#
# squid		Startup script for the SQUID HTTP proxy-cache.
#
# Version:	@(#)squid.rc  2.00  01-Feb-2000  miquels@cistron.nl
#

NAME=squid
DAEMON=/usr/sbin/squid
LIB=/usr/lib/squid
PIDFILE=/var/run/$NAME.pid
SQUID_ARGS="-D -sYC"

PATH=/bin:/usr/bin:/sbin:/usr/sbin

[ -x $DAEMON ] || exit 0

grepconf () {
	w=" 	" # space tab
	sq=/etc/$NAME.conf
	# sed is cool.
	res=`sed -ne '
		s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
		t end;
		d;
		:end q' < $sq`
	[ -z "$res" ] && res=$2
	echo "$res"
}

start () {
	cdr=`grepconf cache_dir /var/spool/$NAME`
	cd $cdr
	start-stop-daemon --quiet --start \
		--pidfile $PIDFILE \
		--exec $DAEMON -- $SQUID_ARGS < /dev/null
	sleep 1
}

stop () {
	start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
	#
	#	Now we have to wait until squid has _really_ stopped.
	#
	sleep 2
	if [ "`pidof -o %PPID -o $$ $DAEMON`" != "" ]
	then
		echo -n "Waiting ."
		cnt=0
		while [ "`pidof -o %PPID -o $$ $DAEMON`" != "" ]
		do
			cnt=`expr $cnt + 1`
			if [ $cnt -gt 60 ]
			then
				#
				#	Waited 120 seconds now. Fail.
				#
				echo -n " Failed.. "
				break
			fi
			sleep 2
			echo -n "."
		done
		[ "$1" = verbose ] && echo "done."
	else
		[ "$1" = verbose ] && echo "$NAME."
	fi
}

case "$1" in
    start)
	echo -n "Starting proxy server: "
	start
	echo "$NAME."
	;;
    stop)
	echo -n "Stopping proxy server: "
	stop verbose
	;;
    reload|force-reload)
	echo "Reloading $NAME configuration files"
	start-stop-daemon --stop --signal 1 \
		--pidfile $PIDFILE --quiet --exec $DAEMON
	;;
    restart)
	echo "Restarting proxy server: "
	stop
	start
	echo "$NAME."
	;;
    *)
	echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}"
	exit 1
	;;
esac

exit 0

#! /bin/bash
#
# apache	Start the apache HTTP server.
#

NAME=apache
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/apache
SUEXEC=/usr/lib/apache/suexec
PIDFILE=/var/run/$NAME.pid
CONF=/etc/apache/httpd.conf
APACHECTL=/usr/sbin/apachectl 

trap "" 1
export LANG=C

test -f $DAEMON || exit 0
test -f $APACHECTL || exit 0

if egrep -q -i "^[[:space:]]*ServerType[[:space:]]+inet" $CONF
then
    exit 0
fi

case "$1" in
  start)
    echo -ne "Starting web server: $NAME.\n"
    $APACHECTL start
    ;;

  stop)
    echo -ne "Stopping web server: $NAME.\n"
    $APACHECTL stop
    ;;

  reload)
    echo -ne "Reloading $NAME configuration.\n"
    $APACHECTL graceful
    ;;

  reload-modules)
    echo -ne "Reloading $NAME modules.\n"
    if [ -f /var/run/apache.pid ]
    then
        $APACHECTL stop
        sleep 4
    fi
    $APACHECTL start
    ;;

  restart)
    $0 reload-modules
    ;;

  force-reload)
    $0 reload-modules
    ;;

  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|reload|reload-modules|force-reload|restart}"
    exit 1
    ;;
esac

exit 0


Reply to: