### Comandos básicos do `systemctl`: - **Verificar status de serviços:** ```bash systemctl status nginx systemctl status apache2.service systemctl status cups systemctl status bluetooth.service ``` - **Iniciar, parar e reiniciar serviços:** ```bash sudo systemctl start apache2.service sudo systemctl stop apache2.service sudo systemctl restart apache2.service ``` - **Ativar e desativar serviços no boot:** ```bash sudo systemctl enable apache2.service --now # Ativa e inicia o serviço sudo systemctl disable apache2.service --now # Desativa e para o serviço ``` - **Verificar se um serviço está habilitado no boot:** ```bash sudo systemctl is-enabled apache2.service ``` ### Serviços múltiplos (cups, bluetooth, etc.): - **Status de múltiplos serviços:** ```bash sudo systemctl status cups-browsed.service accounts-daemon.service cups.service cups.socket ``` - **Habilitar e desabilitar múltiplos serviços:** ```bash sudo systemctl enable cups-browsed.service cups.socket cups.service sudo systemctl disable cups-browsed.service cups.socket cups.service --now ``` - **Verificar se múltiplos serviços estão habilitados:** ```bash systemctl is-enabled cups-browsed.service cups.socket cups.service ``` ### Análise e diagnósticos: - **Analisar tempos de inicialização de serviços:** ```bash systemd-analyze systemd-analyze blame ``` - **Monitorar uso de cgroups:** ```bash systemd-cgtop sudo systemd-cgtop -m ``` ### Outros comandos úteis: - **Visualizar o conteúdo de unidades de serviço:** ```bash systemctl cat docker.socket systemctl cat cups.socket systemctl cat bluetooth # SysVinit Service cat /etc/init.d/bluetooth ``` - **Listar unidades e verificações adicionais:** ```bash ls /etc/systemd/system ls -l /etc/systemd/system/bluetooth.target.wants ```