Estou tentando reiniciar o nginx e o systemd não quer.
Tanto quanto eu posso dizer, o nginx está funcionando bem, e está respondendo pedidos como esperado, mas o systemd não parece achar que está no controle do serviço, então eu acho que ele tenta iniciar uma nova cópia, que falha porque agora ele tenta se ligar a: 80 que já está sendo usado.Depois de solucionar o problema, desisti e reiniciei a máquina, imaginando que isso resolveria o problema, mas, para minha surpresa, isso me coloca de volta no mesmo estado novamente.
A única maneira que posso encontrar para tornar o sistema feliz é
# killall nginx
# systemctl restart nginx.service
Mas eu obviamente não quero contar com isso. Informações sobre meu estado atual:
# systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
# journalctl -xe
-- Unit nginx.service has begun starting up.
Oct 22 12:12:43 shared1 nginx[4772]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx[4772]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx[4772]: nginx: [emerg] still could not bind()
systemd[1]: nginx.service: Control process exited, code=exited status=1
systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed
# netstat -lpn | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3607/nginx
# ps fax | grep nginx
4827 pts/0 S+ 0:00 \_ grep --color=auto nginx
3607 ? Ss 0:00 nginx: master process /usr/sbin/nginx
3608 ? S 0:00 \_ nginx: worker process
3609 ? S 0:00 \_ nginx: cache manager process
# cat /etc/issue
Ubuntu 16.04.3 LTS \n \l
$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
$ find /etc/systemd/ /lib/systemd/system -name nginx.service
/etc/systemd/system/multi-user.target.wants/nginx.service
/lib/systemd/system/nginx.service
$ stat /etc/systemd/system/multi-user.target.wants/nginx.service 2>&1 | head -n1
File: '/etc/systemd/system/multi-user.target.wants/nginx.service' -> '/lib/systemd/system/nginx.service'
$ stat /lib/systemd/system/nginx.service 2>&1 | head -n2
File: '/lib/systemd/system/nginx.service'
Size: 986 Blocks: 8 IO Block: 4096 regular file