Bonjour MisterFreez
[quote=“MisterFreez”]Et sinon c’est quoi ton problème ? Tu as un message d’erreur ou un comportement quelconque à part « ça marche pas » ?
Contrairement à ce que tu dis ce n’est pas parce que l’erreur de l’option pour optimiser la compilation est écartée que c’est forcément une erreur de simple ou double guillemets (d’ailleurs le fait que cela fonctionne en interactif montre que l’erreur ne vient pas de là).[/quote]
Ca doit simplement venir du fait que j’ai “beaucoup” bricolé mon système, et qu’à force de faire des con…ries, j’ai du planter quelque chose.
Mais comme je n’y arrivais pas, j’ai refait une “clean install” de mon serveur, et maintenant, comme par magie, mon script fonctionne.
Et il fonctionne même dans la version d’origine qui utilise waf tout comme avec la ligne de compilation qui maintenant fonctionne aussi. 
[quote=“MisterFreez”]Sans que cela soit un problème ton script ne gère pas super bien le déplacement dans les répertoires. Le premier cd est dépendant du répertoire d’où tu appel ton script, donc tu n’a pas de garanti qu’il y ai un répertoire Download. Je présume que tu voudrais plutôt faire :
[code]cd “${HOME}/Download”
ou
cd ~/Download[/code]
Le dernier cd est inutile car les cd dans ton script n’influent pas sur le répertoire de travail de celui qui lance le script.
D’autre part une bonne pratique au lieu d’utiliser ~/Download serait d’utiliser un répertoire temporaire. Pour ça à la place du "cd “${HOME}/Download”, je ferais plutôt :
tmpdir="$(mktemp -d)"
cd "${tmpdir}"
Éventuellement à la fin du script tu peut supprimer le dossier (sinon il le sera au prochain redémarrage).[/quote]
Merci de ces infos à propos de “${HOME}/Download” que je ne connaissais pas.
J’ai modifié mon script en conséquence, et maintenant, comme je ne veux pas supprimer immédiatement le répertoire temporaire, il fait ce qui suit:
[code]#!/bin/bash
wsbt.sh
Download and install weighttp and clwsbt, two benchmark tools stressing any
web servers on modern multi core CPUs (AMD and Intel).
Launch this installation script with root privileges (sudo or su) from your
/home directory.
e.g. sudo sh wsbt.sh
mkdir “${HOME}/Temp_WSBT”
cd “${HOME}/Temp_WSBT”
wget http://dist.schmorp.de/libev/libev-4.15.tar.gz
wget http://cgit.lighttpd.net/weighttp.git/snapshot/weighttp-master.tar.gz
wget http://www.as2.com/linux/tools/clwsbt.tar.gz
tar -xzf libev-4.15.tar.gz
tar -xzf weighttp-master.tar.gz
tar -xzf clwsbt.tar.gz
apt-get -y build-dep libev
apt-get -y install libev-dev
cd “${HOME}/Temp_WSBT/libev-4.15”
./configure
make clean
make
make install
cd “${HOME}/Temp_WSBT/weighttp-master”
./waf configure
./waf build
./waf install
Note:
If you can’t make waf working on your system, use the following commands
from /home/Temp_WSBT/weighttp-master to compile weighttp and copy it into
the right place:
gcc -g2 -O2 -DVERSION=’“123”’ src/*.c -o weighttp -lev -lpthread
sudo cp ./weighttp /usr/local/bin
cd “${HOME}/Temp_WSBT”
gcc -O2 clwsbt.c -lpthread -o clwsbt
chmod -R 777 “${HOME}/Temp_WSBT”
cd “${HOME}”
echo “-------------------------------------------------------------------------”
echo “weighttp and clwsbt are installed.”
echo " "
echo "To use weighttp, simply start the command: weighttp -h "
echo " "
echo “By default, clwsbt stress a web server listening on the TCP port 8080”
echo “with a static file named 100.html but you can use any other static file”
echo “or even a dynamic content.”
echo " "
echo “However, using large files or big generated dynamic contents stress more”
echo “first the I/O system and the TCP stack than the real capabilities of your”
echo “web server to support large simultaneous loads!”
echo " "
echo “In the same spirit, it’s obvious to use both of these tools with localhost”
echo “connections to avoid the latency of the network.”
echo " "
echo “To use clwsbt:”
echo “launch from your /home/Temp-WSBT folder the following command:”
echo “./clwsbt name_of_your_web_server”
echo “e.g.: ./clwsbt apache2 or ./clwsbt cherokee or ./clwsbt nginx etc.”
echo " "
echo “To stress your web server on another TCP port, please check the”
echo “clwsbt.c source file, and modify the relevant declarations such as”
echo “the listening port, but also the name of the result file, etc…”
echo “Then recompile clwsbt.c using the script compile-clwsbt”
echo " "
echo “e.g. to stress Nginx listening on the port 80 please do the following:”
echo " "
echo “- modify the declaration #define PORT value to 80”
echo “- modify the declaration #define RESFILE value to nginx-results.txt”
echo “- save the source file clwsbt.c as clwsbt-nginx.c”
echo "- compile the new file with the command: "
echo “sudo gcc -o2 clwsbt-nginx.c -lpthread -o clwsbt-nginx”
echo “- put the 100.html file into the /www folder of Nginx”
echo “- restart Nginx”
echo “- start the command: ./clwsbt-nginx nginx”
echo " "
echo “Then compare the results with what you get with other web servers such”
echo “as apache2, cherokee, lighttpd, nginx, g-wan, etc. :=}”
echo “-------------------------------------------------------------------------”
echo " "
[/code]
J’espère que c’est ainsi plus propre et explicite si jamais ça peut servir à d’autres.
Merci encore de tes infos.