title: centos 7: nginx Failed to read PID from file /run/nginx.pid: Invalid argument
body: <p>I can access the nginx welcome page after installing nginx. However, when i run <code>systemctl status nginx</code>, I get this warning: </p>
  
  <blockquote>
    <p>systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid
    argument</p>
  </blockquote>
  
  <p>Can you please tell me what causes this problem and how to fix it? Thanks.</p>
  
  <p>Detailed response message: </p>
  
  <pre>
  nginx.service - The nginx HTTP and reverse proxy server    
  Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)    
  Active: active (running) since Thu 2017-03-02 06:43:24 CST; 2s ago   
  Process: 24007 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)   
  Process: 8377 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)   
  Process: 8374 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)   
  Process: 8373 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)  
  Main PID: 8380 (nginx)    CGroup: /system.slice/nginx.service
             |-8380 nginx: master process /usr/sbin/ngin
             `-8381 nginx: worker proces
  
  Mar 02 06:43:24 VM_134_114_centos systemd[1]: Starting The nginx HTTP and reverse proxy server... 
  Mar 02 06:43:24 VM_134_114_centos nginx[8374]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 
  Mar 02 06:43:24 VM_134_114_centos nginx[8374]: nginx: configuration file /etc/nginx/nginx.conf test is successful 
  Mar 02 06:43:24 VM_134_114_centos systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument 
  Mar 02 06:43:24 VM_134_114_centos systemd[1]: Started The nginx HTTP and reverse proxy server.
  </pre>