Aquesta és una revisió antiga del document


LPIC2 2021 Sesión 4 (2021-02-11)

  • Presentaciones/2020/201/202 - Arranque del Sistema.pdf

SystemV

SystemD

  • levanta los servicios de manera paralela
  • systemd-cgls: procesos en arbol
  • systemd-cgtop
  • systemd-analyze
    • blame: tiempos de arranque de los servicios, para ver quien es el lento
    • plot > /var/www/html/plot.html
Units
  • service
  • socket
  • device
  • mount
  • automount
  • target (runlevels)
  • snapshot
  • cgroups: gestión en caliente de CPU,RAM,DISCO
  • service es unit por defecto (se puede omitir en los comandos)
  • systemctl <accion> <unidad>
  • start
  • stop
  • enable: activa en el arranque
  • enable –now
  • disable
  • reload
  • status

targets

  • los runlevels en systemV
  • cat /etc/inittab
  • runlevelX.target o <NOMBRE>.target
    • 0: halt?
    • 1: rescue.target
    • 2:
    • 3:
    • 4: multi-user.target
    • 5: graphical.target
    • 6: reboot.target
  • systemctl get-default
  • systemctl set-default <TARGET>.target
  • systemctl isolate <TARGET>.target → init o telinit en systemV
snapshot
mask
  • para e impide ejecución de un servicio (o unidad?)
  • systemctl mask nombre.service
  • systemctl unmask nombre.service
laboratorio1
  • Material Practicas LPIC-2/LPIC-201/3-System Startup/SystemD/Laboratorio 1 Gestion de servicios con systemctl:
    • systemctl list-units –type service: servicios activos
    • systemctl list-units –type service –all: servicios activos e inactivos
    • systemctl start|stop|restart|try-restart|reload|status|is-enabled|is-active nombre.service: operaciones con servicios
      • try-restart: solo hace restart si está arrancado
    • systemctl enable|disable nombre.servicio: activar en arranque
    • systemctl kill [-s SIGKILL] nombre.servicio: parar servicios
    • systemctl reboot|halt|poweroff: reboot, halt
    • systemctl mask|unmask: enmascara un servicio, impide que se ponga en marcha
Laboratorio 2
  • Material Practicas LPIC-2/LPIC-201/3-System Startup/SystemD/Laboratorios-2 Systemd:, página 9
    • units propias: /etc/systemd/system/
      • no funciona mask
    • /usr/lib/systemd/system/: unidades distribuidos con paquetes instalados
    • /run/systemd/system/: unidades creadas en tiempo de ejecución. Tiene tiene precedencia sobre el directorio anterior
    • /etc/systemd/system/: unidades creadas y administradas por el administrador del sistema
    • systemctl cat <unit>: muestra el contenido y ubicación del archivo
    • systemctl edit --full <unit>: editar la unidad
    • archivos .service personalizados
      • cd /opt/scripts
        chmod 700 supervisamem
        chmod 700 /etc/init.d/iniciar-supervisamema
      • cd /etc/systemd/system
        vi supervisamem.service
      • [Unit]
        Description=Daemon of axample
        [Service]
        ExecStart=/etc/init.d/iniciar-supervisamem start
        ExecStop=/etc/init.d/iniciar-supervisamem stop
        Type=forking
        [Install]
        WantedBy=multi-user.target
      • systemctl daemon-reload
        systemctl start supervisamem.service
        tail -f /var/log/supervisamem.log
        systemctl stop supervisamem
         
        systemctl enable suspervisamem.service
         
         
        systemd-cgtop

GRUB

  • info/cursos/pue/lpic2-2021/s4.1613070721.txt.gz
  • Darrera modificació: 11/02/2021 11:12
  • per mate