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
création+catégories
 
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
{{important|A mettre jour !!!}}
== Pré-requis ==
== Pré-requis ==
Sous Debian/Ubuntu il faudra installer :
Sous Debian/Ubuntu il faudra installer le paquet {{value|chkconfig}}, qui semble installer par défaut sur RedHat/CentOS :
<syntaxhighlight lang="bash">sudo apt-get install chkconfig</syntaxhighlight>
<syntaxhighlight lang="bash">sudo apt-get install chkconfig</syntaxhighlight>
Le paquet semble installer par défaut sur RedHat/CentOS


== Apache/Httpd ==
== Apache/Httpd ==
=== Vérification ===
=== RedHat/CentOS ===
==== RedHat/CentOS ====
<syntaxhighlight lang="bash">chkconfig --list httpd</syntaxhighlight>
<syntaxhighlight lang="bash">chkconfig --list httpd</syntaxhighlight>
==== Debian/Ubuntu ====
<syntaxhighlight lang="text">httpd                  0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
=== Debian/Ubuntu ===
<syntaxhighlight lang="bash">chkconfig --list apache2</syntaxhighlight>
<syntaxhighlight lang="bash">chkconfig --list apache2</syntaxhighlight>
=== Résultat ===
<syntaxhighlight lang="text">apache2                  0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
<syntaxhighlight lang="bash">apache2                  0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>


== PostgreSQL ==
== PostgreSQL ==
=== Vérification ===
<syntaxhighlight lang="bash">chkconfig --list postgresql</syntaxhighlight>
<syntaxhighlight lang="bash">chkconfig --list postgresql</syntaxhighlight>
=== Résultat ===
<syntaxhighlight lang="text">postgresql                0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
<syntaxhighlight lang="bash">postgresql                0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>


== Tomcat6 ==
== Tomcat6 ==
{{important|'''TODO:''' Si on utilise une configuration manuelle cette vérification n'est pas bonne}}
{{important|'''TODO:''' Si on utilise une configuration manuelle cette vérification n'est pas bonne}}
=== Vérification ===
<syntaxhighlight lang="bash">chkconfig --list tomcat6</syntaxhighlight>
<syntaxhighlight lang="bash">chkconfig --list tomcat6</syntaxhighlight>
=== Résultat ===
<syntaxhighlight lang="text">tomcat6                0:off  1:off  2:on  3:on  4:on  5:on  6:off</syntaxhighlight>
<syntaxhighlight lang="bash">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 ==
* [https://en.wikipedia.org/wiki/Runlevel Runlevel] @ Wikipedia


[[category:How To]]
[[category:How To]]
Ligne 33 : Ligne 53 :
[[category:PostgreSQL]]
[[category:PostgreSQL]]
[[category:Installation]]
[[category:Installation]]
[[category:Odysseo]]

Dernière version du 24 avril 2013 à 10:12

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*