systemctl

  • systemctl reboot
  • systemctl halt
  • systemctl poweroff
  • polkit es necesario para la gestión de energía:
    • systemctl suspend
    • systemctl hibernate
    • systemctl hybrid-sleep

global:

  • listar todos los servicios activos en ejecución: systemctl list-units --type service
  • listar todos los servicios activos/inactivos: systemctl list-units --type service --all
  • listar servicios que han fallado: systemclt --failed
  • listar servicios cargados: systemctl -t service

individual:

  • comprobar estado servicio: systemctl status nombre.service
  • comprobar si está habilitado: systemctl is-enabled nombre.service
  • comprobar si está activado: systemctl is-active nombre.service
  • comprobar status en otra máquina: systemctl status sshd -H user@maquina (pide contraseña de user)
  • habilitar un servicio: systemctl enable nombre.service
  • deshabilitar un servicio: systemctl disable nombre.servicio
  • Inciciar, parar o reiniciar un servicio: systemctl {start|stop|restart} nombre.service
  • Reiniciar servicio (solo si ya lo está): systemctl try-restart nombre.service
  • recargar configuración: systemctl reload nombre.service
  • cambiar a la unidad de destino predeterminada: systemctl default
  • iniciar la unidad especificada, detener el resto: systemctl isolate nombre.target

cuando se enmascara un servicio, se deshabilita y se anula inicio manual o automático

  • systemctl mask nombre.service
  • systemctl unmask nombre.service
  • análisis tiempo inicio: systemd-analyze
  • arbol de procesos arrancado por cada servicio: systemd-cgls
  • systemctl is-active –quiet <SERVICIO>
    • retorna en $? el estado… 0 para activo, no 0 para el resto
  • linux/systemd/systemctl.txt
  • Darrera modificació: 19/03/2020 03:24
  • per mate