Reinicialização automática do apache2 no travamento com o systemd (Ubuntu 15.10)

0

Não há arquivo apache2.service no ubuntu 15.10. Eu quero reiniciar o apache2 se o processo apache2 for morto. Para a maioria dos serviços, posso adicionar um

...
[Service]
Type=simple
ExecStart=/path/to/bin
Restart=on-failure
...

para o arquivo * .service

Se eu ativar o apache2 como um serviço systemd, obtenho:

systemctl enable apache2
apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable apache2

Portanto, está usando a compatibilidade com versões anteriores do System V. Eu tenho que substituir o script /etc/init.d/apache2 e criar um "serviço systemd nativo" ou existe alguma outra solução?

    
por ChupaMe 07.01.2016 / 11:17

1 resposta

0

Você deve conseguir executar sudo systemctl edit apache2.service e inserir substituições personalizadas no arquivo, da seguinte maneira:

[Service]
Restart=on-failure
    
por 08.01.2016 / 15:52