Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Script init.d pour apache 1.3 ?

4 réponses
Avatar
Zouplaz
Bonjour, est-ce que quelqu'un pourrait me copier/coller ici même un script
init.d (pour chkconfig) pour apache 1.3 ? Un qui appelle apachectl... Ca
doit pas être trop sorcier mais si ça existe déjà.

Merci

4 réponses

Avatar
Vincent Ramos
Zouplaz a écrit dans  :

Bonjour, est-ce que quelqu'un pourrait me copier/coller ici même un
script init.d (pour chkconfig) pour apache 1.3 ? Un qui appelle
apachectl... Ca doit pas être trop sorcier mais si ça existe déjà.


C'est le script qu'utilise ma Debian ; attention aux retours à la
ligne ajoutés par le lecteur de news :

#!/bin/bash
#
# apache Start the apache HTTP server.
#
# The variables below are NOT to be changed. They are there to make
the
# script more readable.

NAME=apache
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
CONF=/etc/$NAME/httpd.conf
APACHECTL=/usr/sbin/${NAME}ctl
# note: SSD is required only at startup of the daemon.
SSD=`which start-stop-daemon`
ENV="env -i LANG=C PATH=/bin:/usr/bin:/usr/local/bin"

trap "" 1

# Check that we're not being started by inetd
if egrep -q -i "^[[:space:]]*ServerType[[:space:]]+inet" $CONF
then
exit 0
fi

test_config() {
if [ ! -x $APACHECTL ]; then
echo "$APACHECTL is not executable, exiting"
exit 0
fi

# ensure we don't leak environment vars into apachectl
APACHECTL="$ENV $APACHECTL"

if ! $APACHECTL configtest 2> /dev/null
then
printf "Configuration syntax error detected. Not reloading
nn"
$APACHECTL configtest
exit 1
fi
}

should_start() {
if [ ! -x $DAEMON ]; then
echo "apache is not executable, not starting"
exit 0
fi
}

case "$1" in
start)
should_start
test_config
echo -n "Starting web server: $NAME"
$ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON > /dev/null
;;

stop)
echo -n "Stopping web server: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
rm -rf /var/lib/apache/mod-bandwidth/link/*
;;

reload | force-reload)
test_config
echo -n "Reloading $NAME configuration"
start-stop-daemon --stop --pidfile $PIDFILE --signal USR1
;;

reload-modules)
test_config
echo -n "Reloading $NAME modules"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo --retry 30
should_start
$ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON > /dev/null
;;

restart)
test_config
echo -n "Restarting $NAME"
if ! start-stop-daemon -q --stop --pidfile $PIDFILE --signal HUP;
then
$ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON > /dev/null
fi
;;

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

if [ $? -eq 0 ]; then
echo .
exit 0
else
echo " failed"
exit 1
fi


--
<http://fr.wikipedia.org/wiki/Utilisateur:Vincent_Ramos>

Avatar
Rakotomandimby (R12y) Mihamina
( Sat, 23 Apr 2005 10:08:41 +0000 ) Zouplaz :

Bonjour,


Je n'en ai pas un sous la main, mais si tu cherche un rpm pour fedora/rh,
tu devrasi trouver ton bonheur.

Sur les Fedora/RH, apache 1.x s'appelait apache (les apache 2.0
s'appellent httpd) si tu recupere un src.rpm, tu l'installe:

rpm -i le.src.rpm

Tu vas dans /usr/src/redhat/SOURCES et tu recupere le script. Il est
dedans.

Avatar
TiChou
Dans le message <news:,
*Zouplaz* tapota sur f.c.o.l.configuration :

Bonjour,


Bonjour,

est-ce que quelqu'un pourrait me copier/coller ici même un script
init.d (pour chkconfig) pour apache 1.3 ?


Le mieux, serait de récupérer et d'utiliser celui de votre distribution, non
?

Un qui appelle apachectl... Ca
doit pas être trop sorcier mais si ça existe déjà.


C'est assez simple de construire son propre script d'init, il existe même un
howto qui explique comment construire proprement ce type de script et on
trouve aussi des « skeletons », parfois même dans le répertoire /etc/init.d.

http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html#boot.script

http://www.linuxnetmag.com/share/issue6/skeleton_mandrake
http://www.linuxnetmag.com/share/issue6/skeleton_redhat

Merci


De rien.

--
TiChou

Avatar
Zouplaz
Vincent Ramos wrote in
news:426a31e7$0$20482$:

Zouplaz a écrit dans  :

Bonjour, est-ce que quelqu'un pourrait me copier/coller ici même un
script init.d (pour chkconfig) pour apache 1.3 ? Un qui appelle
apachectl... Ca doit pas être trop sorcier mais si ça existe déjà.


C'est le script qu'utilise ma Debian ; attention aux retours à la
ligne ajoutés par le lecteur de news :



Merci !