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

« Maintenance Redémarrage des services » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
m typo
Ligne 19 : Ligne 19 :
<syntaxhighlight lang="bash">chkconfig --list tomcat6</syntaxhighlight>
<syntaxhighlight lang="bash">chkconfig --list tomcat6</syntaxhighlight>
<syntaxhighlight lang="text">tomcat6                0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
<syntaxhighlight lang="text">tomcat6                0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
==== Scripts personnalisés ====
Sur {{value|Debian}} on a besoin  du paquet
<syntaxhighlight lang="bash">
apt-get update && apt-get install initscripts
</syntaxhighlight>
Puis on édite, en root ({{cmd|su -}}), le fichier {{path|/etc/rc.local}} pour ajouter les commandes de démarrage des serveurs Tomcat (avant le {{cmd|exit 0}}) :
<syntaxhighlight lang="bash"># 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
</syntaxhighlight>
<syntaxhighlight lang="bash">
cp restartProd.sh restartPreProd.sh
perl -i -p -e 's/-prod/-pre-prod/g' restartPreProd.sh
chmod u+x ./restartPr*
</syntaxhighlight>


== Voir aussi ==
== Voir aussi ==

Version du 8 novembre 2012 à 11:36

Pré-requis

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

sudo apt-get install chkconfig

Apache/Httpd

RedHat/CentOS

chkconfig --list httpd
httpd                   0:off  1:off  2:on   3:on   4:on   5:on   6:off

Debian/Ubuntu

chkconfig --list apache2
apache2                   0:off  1:off  2:on   3:on   4:on   5:on   6:off

PostgreSQL

chkconfig --list postgresql
postgresql                0:off  1:off  2:on   3:on   4:on   5:on   6:off

Tomcat6

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

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*


Voir aussi