2017-10-15 3 views
1

これは既知のバグですが、私はそれを解決する方法を知りません。最終的に戻っていくつかの真の解決策を得るためにスタックする:nginx.service:ファイル/run/nginx.pidからPIDを読み込めませんでした:無効な引数ubuntu 16.04 xenial

ファーストでnginxのを私をインストールします:

:私のnginxのサービスの設定は次のようである

sudo apt-get install nginx 

lsb_release -rd 
Description: Ubuntu 16.04.2 LTS 
Release:  16.04 

apt-cache policy nginx-core 
nginx-core: 
    Installed: 1.10.3-0ubuntu0.16.04.2 
    Candidate: 1.10.3-0ubuntu0.16.04.2 
    Version table: 
*** 1.10.3-0ubuntu0.16.04.2 500 
     500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 Packages 
     500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial-security/main amd64 Packages 
     100 /var/lib/dpkg 

/status 
    1.9.15-0ubuntu1 500 
     500 http://sg.mirrors.cloud.aliyuncs.com/ubuntu xenial/main amd64 Packages 

ここ

は、設定されています3210

マイnginx.confファイルのようなある:

user www-data; 
worker_processes auto; 
pid /run/nginx.pid; 

events { 
     worker_connections 768; 
     # multi_accept on; 
} 

http { 

     ## 
     # Basic Settings 
     ## 

     sendfile on; 
     tcp_nopush on; 
     tcp_nodelay on; 
     keepalive_timeout 65; 
     types_hash_max_size 2048; 
     # server_tokens off; 

     # server_names_hash_bucket_size 64; 
     # server_name_in_redirect off; 

     include /etc/nginx/mime.types; 
     default_type application/octet-stream; 

     ## 
     # SSL Settings 
     ## 
tcp_nodelay on; 
     keepalive_timeout 65; 
     types_hash_max_size 2048; 
     # server_tokens off; 

     # server_names_hash_bucket_size 64; 
     # server_name_in_redirect off; 

     include /etc/nginx/mime.types; 
     default_type application/octet-stream; 

     ## 
     # SSL Settings 
     ## 

     ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE 
     ssl_prefer_server_ciphers on; 

     ## 
     # Logging Settings 
     ## 

     access_log /var/log/nginx/access.log; 
     error_log /var/log/nginx/error.log; 

     ## 
     # Gzip Settings 
     ## 

     gzip on; 
     gzip_disable "msie6"; 
    ## 
     # Logging Settings 
     ## 

     access_log /var/log/nginx/access.log; 
     error_log /var/log/nginx/error.log; 

     ## 
     # Gzip Settings 
     ## 

     gzip on; 
     gzip_disable "msie6"; 

     # gzip_vary on; 
     # gzip_proxied any; 
     # gzip_comp_level 6; 
     # gzip_buffers 16 8k; 
     # gzip_http_version 1.1; 
     # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; 

     ## 
     # Virtual Host Configs 
     ## 

     include /etc/nginx/conf.d/*.conf; 
     include /etc/nginx/sites-enabled/*; 
} 


#mail { 
# gzip_comp_level 6; 
     # gzip_buffers 16 8k; 
     # gzip_http_version 1.1; 
     # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; 

     ## 
     # Virtual Host Configs 
     ## 

     include /etc/nginx/conf.d/*.conf; 
     include /etc/nginx/sites-enabled/*; 
} 


#mail { 
#  # See sample authentication script at: 
#  # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript 
# 
#  # auth_http localhost/auth.php; 
#  # pop3_capabilities "TOP" "USER"; 
#  # imap_capabilities "IMAP4rev1" "UIDPLUS"; 
# 
#  server { 
#    listen  localhost:110; 
#    protocol pop3; 
#    proxy  on; 
#  } 
# 
#  server { 
#    listen  localhost:143; 
#    protocol imap; 
#    proxy  on; 

/etc/nginx/nginx.conf ナノ私はnginxのサーバーを起動すると、私はnginxの私のウェブページやステータスに502エラーを取得するには、次のとおりです。

sudo service nginx status 
sudo: unable to resolve host iZt4ndf6hh48rtirr7qry9Z 
● nginx.service - A high performance web server and a reverse proxy server 
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) 
    Active: active (running) since Sun 2017-10-15 16:34:10 CST; 4h 42min ago 
    Process: 2682 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS) 
    Process: 2703 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) 
    Process: 2700 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) 
Main PID: 2706 (nginx) 
    CGroup: /system.slice/nginx.service 
      ├─2706 nginx: master process /usr/sbin/nginx -g daemon on; master_process on 
      └─2707 nginx: worker process 

Oct 15 16:34:10 iZt4ndf6hh48rtirr7qry9Z systemd[1]: Starting A high performance web server and a reverse proxy server... 
Oct 15 16:34:10 iZt4ndf6hh48rtirr7qry9Z systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument 
Oct 15 16:34:10 iZt4ndf6hh48rtirr7qry9Z systemd[1]: Started A high performance web server and a reverse proxy server. 

Googleで検索して、そのバグを見つけましたが、そのエラーを解決しようとしましたが、私はそうすることができません。

貴重な時間をお読みいただきありがとうございます。

+0

'nginx.service'は、インストールに付属または手動でそれを自分で追加?ファイルの内容は正しくないので、 –

+0

には 'nginx.service'が付いています。そこに間違っているものがあります... –

+1

このリンクに記載されたスリープソリューションがhttps://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864に役立つかどうかを確認してください。 –

答えて

3

これは、https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864で説明した競合状態のために発生します。オーバーライドファイルを作成するための

文書化したような回避策は、以下を実行することです

printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf 
systemctl daemon-reload 
systemctl start nginx 
関連する問題