Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

Maintenance Redémarrage des services

De AJLSM
Aller à la navigation Aller à la recherche
Important :
A mettre jour !!!.

Sous Debian/Ubuntu il faudra installer le paquet chkconfig, qui semble installer par défaut sur RedHat/CentOS :

sudo apt-get install chkconfig
chkconfig --list httpd
httpd                   0:off  1:off  2:on   3:on   4:on   5:on   6:off
chkconfig --list apache2
apache2                   0:off  1:off  2:on   3:on   4:on   5:on   6:off
chkconfig --list postgresql
postgresql                0:off  1:off  2:on   3:on   4:on   5:on   6:off
Important :
TODO: Si on utilise une configuration manuelle cette vérification n'est pas bonne.
chkconfig --list tomcat6
tomcat6                0:off  1:off  2:on   3:on   4:on   5:on   6:off

Scripts personnalisés

[modifier | modifier le wikicode]

Sur Debian on a besoin du paquet

apt-get update && apt-get install initscripts

Puis on édite, en root (su -), le fichier /etc/rc.local pour ajouter les commandes de démarrage des serveurs Tomcat (avant le exit 0) :

# Production
/bin/bash /home/ajlsm/restartProd.sh

# Recette
/bin/bash /home/ajlsm/restartPreProd.sh

# le code retour doit être 0 -> on se place avant le exit 0
cp restartProd.sh restartPreProd.sh
perl -i -p -e 's/-prod/-pre-prod/g' restartPreProd.sh
chmod u+x ./restartPr*