Al administrar un servidor pueden ocurrir fallas como servicios que no inician correctamente o sobreestructuración, para darle solución es necesario iniciar, detener, y reiniciar cada servicio e incluso el propio servidor.
Gestión de Servicios
1. Listar los servicios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl |
2. Sintaxis de systemctl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl [opciones] [unidad, proceso o servicio] |
3. Muestra el estado del servicio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl status firewalld.service |
4. Detener un servicio de inmediato.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl stop firewalld.service |
5. Activar un servicio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl start firewalld.service |
6. Reiniciar un servicio.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl restart firewalld.service |
Niveles de Ejecución
En sistemas operativos basados en Linux existen siete niveles de ejecución del 0 al 6 y significan:
» 1 – Modo monousuario.
» 2 – Modo multiusuario.
» 3 – Modo multiusuario completo.
» 4 – Modo personalizado.
» 5 – Modo multiusuario completo.
» 6 – Modo de reinicio.
1. Ejecutar un nivel de ejecución.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Init [número del nivel] |
Solo podemos ejecutar este comando como usuario root, además, este cambio es momentáneo, por lo que al reiniciar el servidor comenzará con su configuración predeterminada. Nunca cambies el nivel de ejecución a 0 o 6, ya que el sistema nunca arrancaría de nuevo y perderías el servidor.
2. Mostrar el nivel de ejecución.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
who -r |
No hay comentarios:
Publicar un comentario