Bug 1309539 - Nginx will fail to start if /var/run/nginx.sock already exists
Nginx will fail to start if /var/run/nginx.sock already exists
Status: CLOSED NOTABUG
Product: Fedora EPEL
Classification: Fedora
Component: nginx (Show other bugs)
epel7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jamie Nguyen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-17 23:45 EST by Horace
Modified: 2016-06-05 13:37 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-05 13:37:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Horace 2016-02-17 23:45:27 EST
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. yum install -y nginx
2. systemctl start nginx
3. systemctl restart nginx

Actual results:
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl 
-xe" for details.

* nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-02-17 23:21:07 EST; 7s ago
  Process: 28866 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
  Process: 28863 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 28860 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 591 (code=exited, status=0/SUCCESS)

Feb 17 23:21:05 mx nginx[28866]: nginx: [emerg] bind() to unix:/var/run/nginx.sock failed (98: Address already in use)
Feb 17 23:21:05 mx nginx[28866]: nginx: [emerg] bind() to unix:/var/run/nginx.sock failed (98: Address already in use)
Feb 17 23:21:06 mx nginx[28866]: nginx: [emerg] bind() to unix:/var/run/nginx.sock failed (98: Address already in use)
Feb 17 23:21:06 mx nginx[28866]: nginx: [emerg] bind() to unix:/var/run/nginx.sock failed (98: Address already in use)
Feb 17 23:21:07 mx nginx[28866]: nginx: [emerg] bind() to unix:/var/run/nginx.sock failed (98: Address already in use)
Feb 17 23:21:07 mx nginx[28866]: nginx: [emerg] still could not bind()
Feb 17 23:21:07 mx systemd[1]: nginx.service: control process exited, code=exited status=1
Feb 17 23:21:07 mx systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Feb 17 23:21:07 mx systemd[1]: Unit nginx.service entered failed state.
Feb 17 23:21:07 mx systemd[1]: nginx.service failed.



Expected results:

Restart successfully

Additional info:

Version     : 1.6.3
Release     : 8.el7
Comment 1 Horace 2016-02-17 23:48:47 EST
Additionally, the current fix is to copy /usr/lib/systemd/system/nginx.service to /etc/systemd/system/nginx.service and add ExecStartPre=/usr/bin/rm -f /var/run/nginx.sock to the service file.
Comment 2 Jamie Nguyen 2016-06-05 13:37:57 EDT
Hi Horace. Thanks for your report. /var/run/nginx.sock isn't used in the default configuration.

Note You need to log in before you can comment on or make changes to this bug.