issue150:certifie_linux
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue150:certifie_linux [2019/11/01 08:44] – d52fr | issue150:certifie_linux [2019/11/04 09:49] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 7: | Ligne 7: | ||
Où nous en sommes : | Où nous en sommes : | ||
https:// | https:// | ||
- | (Sujet 202 : System Startup (Démarrage du système). Dans votre guide d' | + | (Sujet 202 : System Startup (Démarrage du système). Dans votre guide d' |
- | Bonjour aux apprenants et signe de tête à ceux qui sont « juste intéressés ». | + | Bonjour aux apprenants et un signe de tête à ceux qui sont « juste intéressés ». |
- | Comme c'est l' | + | Comme c'est l' |
**Though we are mostly using Ubuntu here, you need to know the Red Hat side of things too. Init is the first process called during SysV boot. This initial process will now start all the other processes that are listed in the runlevel target. Don’t believe me? Look at the PID of init. If Linux was a first person shooter game, the init process would be the spawn point. The init levels today are still the same 0-6 levels (there are more, but unused) that I encountered back in the day; it has not changed, just know the differences between .deb-based systems and .rpmbased systems. You need to know that in older systems, you can usually see what is defined by printing out ‘/ | **Though we are mostly using Ubuntu here, you need to know the Red Hat side of things too. Init is the first process called during SysV boot. This initial process will now start all the other processes that are listed in the runlevel target. Don’t believe me? Look at the PID of init. If Linux was a first person shooter game, the init process would be the spawn point. The init levels today are still the same 0-6 levels (there are more, but unused) that I encountered back in the day; it has not changed, just know the differences between .deb-based systems and .rpmbased systems. You need to know that in older systems, you can usually see what is defined by printing out ‘/ | ||
Ligne 17: | Ligne 17: | ||
The ‘/ | The ‘/ | ||
- | Bien que nous utilisions principalement Ubuntu ici, nous devons connaître aussi la partie concernant Red Hat. Init est le premier traitement appelé pendant le démarrage de SysV. Le processus initial amorcera alors tous les autres processus qui sont listés dans la cible des niveaux d' | + | Bien que nous utilisions principalement Ubuntu ici, nous devons connaître aussi la partie concernant Red Hat. Init est le premier traitement appelé pendant le démarrage de SysV. Le processus initial amorcera alors tous les autres processus qui sont listés dans la cible des niveaux d' |
Le dossier « /etc » est plein de choses. Regardez si vous pouvez trouver les scripts rc. (niveaux d' | Le dossier « /etc » est plein de choses. Regardez si vous pouvez trouver les scripts rc. (niveaux d' | ||
Ligne 23: | Ligne 23: | ||
**Let us talk about those file names you see. K20xxxxx and S20xxxxx first. Kill scripts range from 01-99 and so do start scripts. I know you are smart enough to realize the K or S at the beginning means Kill or Start. They are symbolic links. Your homework is to follow them through. If you don’t already know, this will be a light-bulb moment. The number is the sequence in which it starts, so if you see two with the same number, they will start in parallel. Very simple, no? Well, SysV init is simple compared to systemd. That is also why so many people want rc over systemd (and the fact that it is now binary blobs instead of plain text files). To change startup on SysV init should also be simple, right? Stopping, starting, restarting services are as simple as that, you should know that by now. The LPIC study guide glances right over this subject. I really recommend reading the above free study guide.** | **Let us talk about those file names you see. K20xxxxx and S20xxxxx first. Kill scripts range from 01-99 and so do start scripts. I know you are smart enough to realize the K or S at the beginning means Kill or Start. They are symbolic links. Your homework is to follow them through. If you don’t already know, this will be a light-bulb moment. The number is the sequence in which it starts, so if you see two with the same number, they will start in parallel. Very simple, no? Well, SysV init is simple compared to systemd. That is also why so many people want rc over systemd (and the fact that it is now binary blobs instead of plain text files). To change startup on SysV init should also be simple, right? Stopping, starting, restarting services are as simple as that, you should know that by now. The LPIC study guide glances right over this subject. I really recommend reading the above free study guide.** | ||
- | Parlons des noms des fichiers que vous voyez. K20xxxxx et S20xxxxx d' | + | Parlons des noms des fichiers que vous voyez. K20xxxxx et S20xxxxx d' |
**Now an old CentOS system is not the only one you need to start in a VM, I would suggest an old version of Debian or newer Devuan. Otherwise, the next part will be hard for you to follow. You are expected to know, not only the startup process, but how to customise said process. I need you to look at the man pages: man update-rc.d - have a look at the synopsis. You will also see they refer you to the Debian policy manual. You may ask how this worked in the real word. Well let’s say you want to add the printing service to a runlevel, say CUPS. The service you want to start has to be in: /etc/init.d – you cannot just add a service that does not exist. So the syntax would be: | **Now an old CentOS system is not the only one you need to start in a VM, I would suggest an old version of Debian or newer Devuan. Otherwise, the next part will be hard for you to follow. You are expected to know, not only the startup process, but how to customise said process. I need you to look at the man pages: man update-rc.d - have a look at the synopsis. You will also see they refer you to the Debian policy manual. You may ask how this worked in the real word. Well let’s say you want to add the printing service to a runlevel, say CUPS. The service you want to start has to be in: /etc/init.d – you cannot just add a service that does not exist. So the syntax would be: | ||
Ligne 37: | Ligne 37: | ||
“update-rc.d cups start 58 5 | “update-rc.d cups start 58 5 | ||
. stop 58 0 6 .“** | . stop 58 0 6 .“** | ||
+ | |||
+ | Disons qu'un vieux CentOS n'est pas le seul système que vous devriez démarrer dans une VM ; je vous suggère aussi une vieille version de Debian, ou du plus récent Devuan. Autrement, la suite de l' | ||
+ | |||
+ | update-rc.d <service name> | ||
+ | start < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | Waouh, ça parait horrible, mais en pratique, c'est quelque chose comme ceci : | ||
+ | |||
+ | “update-rc.d cups start 58 5 . stop 58 0 6 .“ | ||
**Note the delimiters - period after start and period after stop. You may get a warning message when changing a service (if it is not the default). | **Note the delimiters - period after start and period after stop. You may get a warning message when changing a service (if it is not the default). | ||
Ligne 45: | Ligne 57: | ||
Back to our Red Hat-based system. Here we use chkconfig. Starting on page 58 in the free study guide, I need you to read it. If you did your homework... and followed the links all the way through... you will know where this is heading. If you looked inside the scripts you may have noticed that right near the top, there is a “chkconfig : “ followed by a number. These are your runlevels. So if you saw “345” following chkconfig, it was not the number three hundred and forty five, but runlevels 3,4,5. Now you can remove or add a runlevel here, but think it through thoroughly before doing so. Let’s say we would like to add cron to another runlevel (example only); then we would add say a two to the list , so it reads “2345” and save the file. This alone does nothing. To ‘pull the changes through, so to speak, in the rc.d folders you need to say the magic phrase in the terminal: chkconfig - -add cron** | Back to our Red Hat-based system. Here we use chkconfig. Starting on page 58 in the free study guide, I need you to read it. If you did your homework... and followed the links all the way through... you will know where this is heading. If you looked inside the scripts you may have noticed that right near the top, there is a “chkconfig : “ followed by a number. These are your runlevels. So if you saw “345” following chkconfig, it was not the number three hundred and forty five, but runlevels 3,4,5. Now you can remove or add a runlevel here, but think it through thoroughly before doing so. Let’s say we would like to add cron to another runlevel (example only); then we would add say a two to the list , so it reads “2345” and save the file. This alone does nothing. To ‘pull the changes through, so to speak, in the rc.d folders you need to say the magic phrase in the terminal: chkconfig - -add cron** | ||
+ | |||
+ | Notez la ponctuation. Un point après start, un point après stop. Vous pourriez recevoir un avetissement après la modification d'un service (si ce n'est pas la valeur par défaut). | ||
+ | |||
+ | Pour supprimer un service, la syntaxe est simple : update-rc.d <service name> remove | ||
+ | |||
+ | Sans tenir compte de tel ou tel service qui ne tourne habituellement, | ||
+ | |||
+ | Revenons à notre système basé sur Red Hat. Là, nous utilisons chkconfig. Je vous demande de lire notre guide d' | ||
**To see what changes were made, navigate to / | **To see what changes were made, navigate to / | ||
Just be aware of the differences in systems syntax between Debian-based and Red Hat-based distributions.** | Just be aware of the differences in systems syntax between Debian-based and Red Hat-based distributions.** | ||
+ | |||
+ | Pour voir ce qui a changé, naviguez vers / | ||
+ | |||
+ | Soyez simplement au courant des différences de syntaxe des systèmes, entre les distributions basées sur Debian et celles basées sur Red Hat. | ||
**No practice exam questions this month, I just want you to physically do it in a Red Hat-based VM and see how it is done. Keep your peepers peeled in the exam for questions that specify RED HAT. | **No practice exam questions this month, I just want you to physically do it in a Red Hat-based VM and see how it is done. Keep your peepers peeled in the exam for questions that specify RED HAT. | ||
Ligne 57: | Ligne 81: | ||
• DO NOT learn these questions parrot fashion, as they are probably not real exam questions. | • DO NOT learn these questions parrot fashion, as they are probably not real exam questions. | ||
- | Let us know how you did; good or bad, it does not matter. Good means you are ready to write and confident in your skills. Bad means you will be learning new stuff!! Yay! There is no downside here. If you do not know why an answer is | + | Let us know how you did; good or bad, it does not matter. Good means you are ready to write and confident in your skills. Bad means you will be learning new stuff!! Yay! There is no downside here. If you do not know why an answer is the way it is, contact us.** |
- | the way it is, contact us.** | + | |
+ | Ce mois-ci, pas de questions d' | ||
+ | |||
+ | Si vous voulez aller plus loin ou tester vos connaissances pour l' | ||
+ | ••Le nouvel numéro d' | ||
+ | ••Le site nécessite une inscription, | ||
+ | ••N' | ||
+ | |||
+ | Dites-nous comment ça s'est passé ! Bien ou mal, ça n'a pas d' | ||
issue150/certifie_linux.1572594277.txt.gz · Dernière modification : 2019/11/01 08:44 de d52fr