Mudanças entre as edições de "Ativar ou desativar serviços no Ubuntu 18.04"
(Criou página com ' Iniciar o servico apache2 service apache2 start service apache2 stop service apache2 status service apache2 restart A partir do Ubuntu 15.04, o Upstart será preterido e...') |
|||
| (3 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 1: | Linha 1: | ||
| + | Atualizar servicos | ||
| + | systemctl daemon-reload | ||
| + | |||
| + | Alterando os privilégios do arquivos (Serviço) | ||
| + | nano /etc/init.d/handle | ||
| + | chmod 755 handle | ||
Iniciar o servico apache2 | Iniciar o servico apache2 | ||
| Linha 32: | Linha 38: | ||
Remove o link /dev/nulle restaura a capacidade de ativar e / ou iniciar manualmente o serviço. | Remove o link /dev/nulle restaura a capacidade de ativar e / ou iniciar manualmente o serviço. | ||
sudo systemctl unmask SERVICE | sudo systemctl unmask SERVICE | ||
| + | |||
| + | = .SERVICE = | ||
| + | cp /tmp/solr.service /etc/systemd/system | ||
| + | systemctl daemon-reload | ||
| + | systemctl start solr.service | ||
| + | systemctl enable solr.service | ||
Edição atual tal como às 00h48min de 3 de fevereiro de 2021
Atualizar servicos
systemctl daemon-reload
Alterando os privilégios do arquivos (Serviço)
nano /etc/init.d/handle chmod 755 handle
Iniciar o servico apache2
service apache2 start service apache2 stop service apache2 status service apache2 restart
A partir do Ubuntu 15.04, o Upstart será preterido em favor do Systemd. Com o Systemd para gerenciar os serviços, podemos fazer o seguinte:
Mostra o status de um serviço. Informa se um serviço está em execução no momento.
systemctl status SERVICE
Liga o serviço, na próxima reinicialização ou no próximo evento de inicialização. Persiste após a reinicialização.
systemctl enable SERVICE
Desativa o serviço na próxima reinicialização ou no próximo evento de parada. Persiste após a reinicialização.
systemctl disable SERVICE
Verifique se um serviço está atualmente configurado para iniciar ou não na próxima reinicialização.
systemctl is-enabled SERVICE
Verifique se um serviço está ativo no momento.
systemctl is-active SERVICE
Mostre todas as informações sobre o serviço.
systemctl show SERVICE -
Desabilite completamente um serviço vinculando-o a /dev/null; você não pode iniciar o serviço manualmente ou habilitá-lo.
sudo systemctl mask SERVICE
Remove o link /dev/nulle restaura a capacidade de ativar e / ou iniciar manualmente o serviço.
sudo systemctl unmask SERVICE
.SERVICE
cp /tmp/solr.service /etc/systemd/system systemctl daemon-reload systemctl start solr.service systemctl enable solr.service