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/10/30 13:29] – auntiee | issue150:certifie_linux [2019/11/04 09:49] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Where we are: https:// | + | **Where we are: https:// |
- | Welcome back learners, and a nod to those “just interested”. | + | Welcome back learners, and a nod to those “just interested”. |
- | 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 | + | Since this is the 201 exam, you should |
- | 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 | + | |
- | systems. You need to know that in older systems, you can usually see what is defined by printing out ‘/ | + | |
- | / | + | |
- | The ‘/etc’-folder is chock full of stuff. See if you can find the rc scripts. (Runlevels | + | Où nous en sommes : |
+ | https://www.lpi.org/ | ||
+ | (Sujet 202 : System Startup (Démarrage du système). Dans votre guide d' | ||
- | 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 | + | Bonjour aux apprenants et un signe de tête à ceux qui sont « juste intéressés ». |
- | 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. | + | |
- | 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: | + | 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 ‘/ | ||
+ | |||
+ | 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' | ||
+ | |||
+ | Le dossier « /etc » est plein de choses. Regardez si vous pouvez trouver les scripts rc. (niveaux d' | ||
+ | |||
+ | **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' | ||
+ | |||
+ | **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: | ||
update-rc.d <service name> | update-rc.d <service name> | ||
Ligne 25: | Ligne 36: | ||
“update-rc.d cups start 58 5 | “update-rc.d cups start 58 5 | ||
- | . stop 58 0 6 .“ | + | . 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). | + | 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). | ||
To remove a service, the syntax is simply: update-rc.d <service name> remove | To remove a service, the syntax is simply: update-rc.d <service name> remove | ||
Ligne 33: | Ligne 56: | ||
Regardless if a service ‘usually’ runs in say, only runlevel 5, you can manually start it from /etc/init.d | Regardless if a service ‘usually’ runs in say, only runlevel 5, you can manually start it from /etc/init.d | ||
- | 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 | + | 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** |
- | through, so to speak, in the rc.d folders you need to say the magic phrase in the terminal: chkconfig - -add cron | + | |
- | To see what changes were made, navigate to /etc/rc.d/rc2.d/ and you should see cron – in our case – has been created. Since the chkconfig was preceded by an octothorpe – it is a comment, but chkconfig read the comments! Neat hey! This is not the only thing chkconfig can do, it is handy beyond this when it comes to services. Linux firewalls work on services, yes, I know, we need a decent application firewall program in Linux, but we do not have any. So a quick way to see which services are on, for firewall configuration, | + | Notez la ponctuation. Un point après start, un point après stop. Vous pourriez recevoir un avetissement après la modification |
- | Just be aware of the differences in systems syntax between Debian-based and Red Hat-based distributions. | + | Pour supprimer un service, la syntaxe est simple : update-rc.d <service name> remove |
- | 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. | + | 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 / | ||
+ | |||
+ | 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. | ||
If you would like to jump ahead, or test your skills at an LPI exam, do a test paper here: https:// | If you would like to jump ahead, or test your skills at an LPI exam, do a test paper here: https:// | ||
Ligne 47: | 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.1572438579.txt.gz · Dernière modification : 2019/10/30 13:29 de auntiee