{"id":102,"date":"2013-03-11T08:28:04","date_gmt":"2013-03-11T07:28:04","guid":{"rendered":"http:\/\/sam-soul.fr\/Info\/?p=102"},"modified":"2021-06-10T11:11:46","modified_gmt":"2021-06-10T09:11:46","slug":"demarrage-automatique-de-service-au-boot-dun-serveur-linux-2","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2013\/03\/11\/demarrage-automatique-de-service-au-boot-dun-serveur-linux-2\/","title":{"rendered":"D\u00e9marrage automatique de service au boot d\u2019un serveur Linux."},"content":{"rendered":"<p>Linux boot :<\/p>\n<p>Il existe plusieurs niveau de boot.<\/p>\n<p>rc0.d Arr\u00eat du serveur linux<\/p>\n<p>rc1.d D\u00e9bug mode console<\/p>\n<p>rc2.d D\u00e9bug mode console<\/p>\n<p>\u00e0 rc3.d Mode console<\/p>\n<p>rc4.d D\u00e9bug mode graphique<\/p>\n<p>\u00e0 rc5.d Mode graphique<\/p>\n<p>rc6.d Reboot du serveur linux<\/p>\n<p><strong>runlevel&nbsp;<\/strong>pour connaitre le niveau de d\u00e9marrage.<\/p>\n<p>exemple : N 3 =====&gt;rc3<\/p>\n<p>N 2 3 =========&gt; dabort le rc2 puis le rc3<\/p>\n<p><strong>vi \/etc\/inittab&nbsp;<\/strong>pour modifier le niveau de d\u00e9marrage<\/p>\n<p># The default runlevel is defined here<br>\nid:<strong>3<\/strong>:initdefault:<\/p>\n<p>On positionne les \u00ab services \u00bb \u00e0 d\u00e9marrer sur les rc3.d et rc5.d.<\/p>\n<p>Les fichiers de commandes sont dans \/etc\/init.d pour pouvoir \u00eatre appel\u00e9s dans les diff\u00e9rents rcX.d<\/p>\n<p>Les chaines d\u2019ex\u00e9cution sont dans les directories \/etc\/rcX.d<\/p>\n<p>Il existe deux types de commandes K (kill) et S (Start)<\/p>\n<p>Les commandes sont num\u00e9rot\u00e9es (chronologiquement) de 00 \u00e0 99.<\/p>\n<p>K01xxx<\/p>\n<p>K02yyy<\/p>\n<p>K03zzz<\/p>\n<p>\u2026.<\/p>\n<p>S01xxx<\/p>\n<p>S02yyy<\/p>\n<p>S03zzz (par exemple)<\/p>\n<p>Les commandes S99zzzzz sont des liens symboliques qui pointent sur des fichiers de commandes ou ex\u00e9cutables.<\/p>\n<p>exemple<\/p>\n<p>Le lien&nbsp;<strong>S99vtom.sh<\/strong>&nbsp;pointe sur&nbsp;<strong>\/etc\/rc.d\/init.d\/boot_start_vtom.sh<\/strong><\/p>\n<p>Le fichier&nbsp;<strong>boot_start_vtom.sh contient&nbsp;<\/strong>la commande \u00e0 executer.<\/p>\n<p>Cr\u00e9ation d\u2019un lien symbolique :<\/p>\n<p>Syntaxe :&nbsp;ln -s nom_du_fichier nom_du_lien<\/p>\n<p>pour le supprimer : rm nom_du_lien<\/p>\n<p>D\u00e9marrage : (client, moteur et serveur Vtom)<\/p>\n<p>root@tic:\/etc\/rc5.d# ln -s ..\/init.d\/boot_start_vtserver S99boot_start_vtserver<\/p>\n<p>root@tic:\/etc\/rc5.d# cd ..\/init.d<\/p>\n<p>root@tic:\/etc\/init.d# vi boot_start_vtserver<\/p>\n<p><em>ajouter la ligne de commande<\/em><\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/boot_start_servers<\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/start_moteurs<\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/boot_start_client<\/p>\n<p>root@tic:\/etc\/init.d# chmod 755 boot_start_vtserver<\/p>\n<p>root@tic:\/etc\/rc5.d# cd ..\/rc3.d<\/p>\n<p>root@tic:\/etc\/rc3.d# ln -s ..\/init.d\/boot_start_vtserver S99boot_start_vtserver<\/p>\n<p>Arr\u00eat : (client, moteur et serveur Vtom)<\/p>\n<p>root@tic:\/etc\/rc5.d# ln -s ..\/init.d\/stop_vtserver K99stop_vtserver<\/p>\n<p>root@tic:\/etc\/rc5.d# cd ..\/init.d<\/p>\n<p>root@tic:\/etc\/init.d# vi stop_vtserver<\/p>\n<p><em>ajouter la ligne de commande<\/em><\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/stop_servers<\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/stop_moteurs<\/p>\n<p>su -l vtom -c \/opt\/vtom\/admin\/stop_client<\/p>\n<p>root@tic:\/etc\/init.d# chmod 755 stop_vtserver<\/p>\n<p>root@tic:\/etc\/rc5.d# cd ..\/rc3.d<\/p>\n<p>root@tic:\/etc\/rc3.d# ln -s ..\/init.d\/stop_vtserver K99stop_vtserver<\/p>\n<p>M\u00e9mo pour start auto de VTOM :<\/p>\n<p><strong>cd \/etc\/rc.d\/init.d<\/strong><\/p>\n<p><strong>vi boot_start_vtom.sh<\/strong><\/p>\n<p>su -l vtom -c \/opt\/vtom53\/admin\/boot_start_client<\/p>\n<p><strong>vi boot_stop_vtom.sh<\/strong><\/p>\n<p>su -l vtom -c \/opt\/vtom53\/admin\/stop_client<\/p>\n<p><strong>cd \/etc\/rc3.d<\/strong><\/p>\n<p>ln -s ..\/init.d\/boot_stop_vtom.sh K99boot_stop_client<\/p>\n<p>ln -s ..\/init.d\/boot_start_vtom.sh S99boot_start_client<\/p>\n<div>\n<p><strong>cd \/etc\/rc5.d<\/strong><\/p>\n<p>ln -s ..\/init.d\/boot_stop_vtom.sh K99boot_stop_client<\/p>\n<p>ln -s ..\/init.d\/boot_start_vtom.sh S99boot_start_client<\/p>\n<p><strong>Il faut tester :<\/strong><\/p>\n<p>[root@pdtb2 rc3.d]#<strong>&nbsp;.\/K99boot_stop_client<\/strong><br>\nLe client Visual TOM est arrete.<br>\n[root@pdtb2 rc3.d]#&nbsp;<strong>.\/S99boot_start_client<\/strong><br>\nLe client Visual TOM est actif sur pdtb2.<\/p>\n<\/div>\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-info\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"iY4NDvV5Of\"><a href=\"http:\/\/les-fougs.com\/wordpress\/2019\/09\/19\/systemctl-start-vtom_bdaemon-service\/\">systemctl start vtom_bdaemon.service<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&laquo;&nbsp;systemctl start vtom_bdaemon.service&nbsp;&raquo; &#8212; info\" src=\"http:\/\/les-fougs.com\/wordpress\/2019\/09\/19\/systemctl-start-vtom_bdaemon-service\/embed\/#?secret=iY4NDvV5Of\" data-secret=\"iY4NDvV5Of\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Linux boot : Il existe plusieurs niveau de boot. rc0.d Arr\u00eat du serveur linux rc1.d D\u00e9bug mode console rc2.d D\u00e9bug mode console \u00e0 rc3.d Mode console rc4.d D\u00e9bug mode graphique \u00e0 rc5.d Mode graphique rc6.d Reboot du serveur linux runlevel&nbsp;pour connaitre le niveau de d\u00e9marrage. exemple : N 3 =====&gt;rc3 N 2 3 =========&gt; dabort &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2013\/03\/11\/demarrage-automatique-de-service-au-boot-dun-serveur-linux-2\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;D\u00e9marrage automatique de service au boot d\u2019un serveur Linux.&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[51],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/102"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":1,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":2487,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/102\/revisions\/2487"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}