nginx wont be started (needs network-online.target?)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nginx (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
Nginx is configured and will start if started manually by "systemctl start nginx"
But it wont start after (re)booting.
# systemctl enable nginx
# systemctl is-enabled nginx
enabled
# reboot
[...]
# systemctl is-enabled nginx
enabled
# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Tue 2019-10-29 10:03:14 CET; 6s ago
Docs: man:nginx(8)
Process: 10406 ExecStop=
Process: 10026 ExecStart=
Process: 10025 ExecStartPre=
Main PID: 10027 (code=exited, status=0/SUCCESS)
Okt 29 09:55:23 nc158-muc systemd[1]: Starting A high performance web server and a reverse proxy server...
Okt 29 09:55:23 nc158-muc systemd[1]: Started A high performance web server and a reverse proxy server.
Okt 29 10:03:14 nc158-muc systemd[1]: Stopping A high performance web server and a reverse proxy server...
Okt 29 10:03:14 nc158-muc systemd[1]: Stopped A high performance web server and a reverse proxy server.
# pgrep nginx
#
# systemctl start nginx
# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/
Active: active (running) since Tue 2019-10-29 10:04:30 CET; 8s ago
Docs: man:nginx(8)
Process: 10406 ExecStop=
Process: 10415 ExecStart=
Process: 10414 ExecStartPre=
Main PID: 10416 (nginx)
Tasks: 5 (limit: 4915)
CGroup: /system.
├─10416 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─10417 nginx: worker process
├─10418 nginx: worker process
├─10419 nginx: worker process
└─10420 nginx: worker process
Okt 29 10:04:30 nc158-muc systemd[1]: Starting A high performance web server and a reverse proxy server...
Okt 29 10:04:30 nc158-muc systemd[1]: Started A high performance web server and a reverse proxy server.
# pgrep nginx
10416
10417
10418
10419
10420
#
I'd awaited nginx to be started after network is up!
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: nginx 1.14.0-0ubuntu1.6
ProcVersionSign
Uname: Linux 4.15.0-67-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
Date: Tue Oct 29 09:56:19 2019
Dependencies:
InstallationDate: Installed on 2014-01-31 (2096 days ago)
InstallationMedia: Ubuntu-Server 13.10 "Saucy Salamander" - Release amd64 (20131016)
PackageArchitec
ProcEnviron:
TERM=screen
PATH=(custom, no user)
XDG_RUNTIME_
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: nginx
UpgradeStatus: Upgraded to bionic on 2018-11-23 (339 days ago)
It may be that your system has been upgraded from an earlier Ubuntu version and some of its config/service files have desync'd from correct defaults, but to check this we'll need to look at some of these files. To the best of my knowledge, just running `systemctl enable nginx` as you've done should be enough to get it starting on boot, so I'm guessing there's some other missing config.
Please attach the following to this bug report:
/lib/systemd/ system/ nginx.service nginx.conf
/etc/nginx/
Output of `dpkg -l | grep -i nginx`
Output of `sudo journalctl -u nginx`
Output of `sudo nginx -t`
I *think* that should provide enough info to figure out what's going on. If there are any other logs or config files you notice while collecting these that look relevant, please include them as well.
The fix is likely going to be some tweak to your nginx.service file. If you'd like to tinker directly, you might find LP: #1818574 of interest; it's a slightly different problem but probably a similar fix. There's some good systemd configuration guides on the web you can refer to for ideas. Otherwise, add the above files here and one of us will take a look.