Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Lab 17.1RHCSA 10, Hoofdstuk 17

Work with targets

Niveau
Makkelijk
20 min
Machines
server1
Status
Nog niet begonnen

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Doel

Find out what the system boots into, change it, switch targets without a reboot, and see how enable works.

Voordat je begint

  • Work on the console of server1 (not over SSH) as root.

Taken

  1. Show the default target and all active targets.
  2. Make the system boot into text mode (no desktop) by default.
  3. Switch to text mode now, without a reboot. Then go back.
  4. Enable httpd and show the link that systemd created. Which target pulls it in?
  5. Reboot and check the default target and that httpd runs.

Controleer je werk

systemctl get-default
ls -l /etc/systemd/system/default.target
ls /etc/systemd/system/multi-user.target.wants/ | grep httpd
systemctl is-active httpd
  • get-default = multi-user.target.
  • default.target is a link to multi-user.target.
  • httpd.service is in multi-user.target.wants.

Hints

Toon de hints

Oplossing

Toon de oplossing
  1. Default and active targets.
    systemctl get-default
    systemctl list-units -t target
  2. Text mode by default.
    systemctl set-default multi-user.target
  3. Switch now and back (on a system with a desktop).
    systemctl isolate multi-user.target
    systemctl isolate graphical.target
  4. Enable and look at the link.
    systemctl enable --now httpd
    ls -l /etc/systemd/system/multi-user.target.wants/httpd.service
    grep WantedBy /usr/lib/systemd/system/httpd.service
  5. Reboot and check.
    systemctl reboot
    systemctl get-default; systemctl is-active httpd

Mijn notities

Nog geen notities.

Lessen voor dit lab

Commando's in dit lab