Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
schroot [Le 01/09/2022, 00:00] moths-art Passage de http à https sur les liens externes (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) |
schroot [Le 07/01/2023, 15:18] (Version actuelle) Amiralgaby [Installation du serveur LAMP] utilisation de guillemets dans le script pour éviter les "words-splitting" |
||
---|---|---|---|
Ligne 131: | Ligne 131: | ||
=== Démarrage automatique du serveur lamp === | === Démarrage automatique du serveur lamp === | ||
- | Pour démarrer de façon automatique la chroot et tout les services que vous désirez, je vous propose ce script : | + | Pour démarrer de façon automatique la chroot et tout les services que vous désirez, je vous propose ce script : |
<code bash> | <code bash> | ||
#!/bin/bash | #!/bin/bash | ||
Ligne 155: | Ligne 155: | ||
SCHROOT_ID=$(schroot -b -c lenny) | SCHROOT_ID=$(schroot -b -c lenny) | ||
- | schroot -r -c $SCHROOT_ID /etc/init.d/mtab.sh | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/mtab.sh |
- | schroot -r -c $SCHROOT_ID /etc/init.d/mysql start | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/mysql start |
- | schroot -r -c $SCHROOT_ID /etc/init.d/apache2 start | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/apache2 start |
- | schroot -r -c $SCHROOT_ID /etc/init.d/exim4 start | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/exim4 start |
mkdir /tmp/schroot/ | mkdir /tmp/schroot/ | ||
- | echo $SCHROOT_ID > /tmp/schroot/$NAMESCRIPT | + | echo "$SCHROOT_ID" > /tmp/schroot/$NAMESCRIPT |
elif [ -e "/tmp/schroot/$NAMESCRIPT" ]; then | elif [ -e "/tmp/schroot/$NAMESCRIPT" ]; then | ||
Ligne 172: | Ligne 172: | ||
if [ -e "/tmp/schroot/$NAMESCRIPT" ]; then | if [ -e "/tmp/schroot/$NAMESCRIPT" ]; then | ||
SCHROOT_ID=$(cat /tmp/schroot/$NAMESCRIPT) | SCHROOT_ID=$(cat /tmp/schroot/$NAMESCRIPT) | ||
- | schroot -r -c $SCHROOT_ID /etc/init.d/mysql stop | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/mysql stop |
- | schroot -r -c $SCHROOT_ID /etc/init.d/apache2 stop | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/apache2 stop |
- | schroot -r -c $SCHROOT_ID /etc/init.d/exim4 stop | + | schroot -r -c "$SCHROOT_ID" /etc/init.d/exim4 stop |
- | schroot -e -c $SCHROOT_ID | + | schroot -e -c "$SCHROOT_ID" |
rm -R /tmp/schroot/ | rm -R /tmp/schroot/ |