Ori.livneh has submitted this change and it was merged.

Change subject: uWSGI apps should place sockets in /run/uwsgi
......................................................................


uWSGI apps should place sockets in /run/uwsgi

/var/run/{gdash,graphite-web} are wiped on boot and not recreated until Puppet
has had a chance to run, causing the services to fail to start. Instead, gdash
and graphite-web should place their sockets in /run/uwsgi, the creation of
which is ensured by the uwsgi master init Upstart job.

Change-Id: I2846330f7ca3438ae2d73448a5cdfccb6179f653
---
M modules/gdash/manifests/init.pp
M modules/gdash/templates/gdash.nginx.erb
M modules/graphite/manifests/web.pp
M modules/graphite/templates/graphite.nginx.erb
M templates/apache/sites/gdash.wikimedia.org.erb
M templates/graphite/graphite.apache.erb
6 files changed, 10 insertions(+), 18 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Rush: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/gdash/manifests/init.pp b/modules/gdash/manifests/init.pp
index b1a9a16..dbf4da5 100644
--- a/modules/gdash/manifests/init.pp
+++ b/modules/gdash/manifests/init.pp
@@ -75,19 +75,12 @@
         source  => $template_source,
     }
 
-    file { '/var/run/gdash':
-        ensure => directory,
-        owner  => 'www-data',
-        group  => 'www-data',
-        mode   => '0755',
-    }
-
     uwsgi::app { 'gdash':
-        require  => File['/etc/gdash/gdash.yaml', '/etc/gdash/config.ru', 
'/var/run/gdash'],
+        require  => File['/etc/gdash/gdash.yaml', '/etc/gdash/config.ru'],
         settings => {
             uwsgi => {
-                'socket'         => '/var/run/gdash/gdash.sock',
-                'stats'          => '/var/run/gdash/gdash-stats.sock',
+                'socket'         => '/run/uwsgi/gdash.sock',
+                'stats'          => '/run/uwsgi/gdash-stats.sock',
                 'rack'           => '/etc/gdash/config.ru',
                 'post-buffering' => 4096,  # required by the Rack 
specification.
                 'master'         => true,
diff --git a/modules/gdash/templates/gdash.nginx.erb 
b/modules/gdash/templates/gdash.nginx.erb
index fc15ff1..eee4ec6 100644
--- a/modules/gdash/templates/gdash.nginx.erb
+++ b/modules/gdash/templates/gdash.nginx.erb
@@ -2,7 +2,7 @@
 # This file is managed by Puppet
 
 upstream gdash {
-    server unix:/var/run/gdash/gdash.sock;
+    server unix:/run/uwsgi/gdash.sock;
 }
 
 server {
diff --git a/modules/graphite/manifests/web.pp 
b/modules/graphite/manifests/web.pp
index cf7cdfa..b088ee0 100644
--- a/modules/graphite/manifests/web.pp
+++ b/modules/graphite/manifests/web.pp
@@ -53,7 +53,6 @@
     file { [
         '/var/lib/graphite-web',
         '/var/log/graphite-web',
-        '/var/run/graphite-web',
     ]:
         ensure  => directory,
         owner   => 'www-data',
@@ -90,15 +89,15 @@
         settings => {
             uwsgi => {
                 'plugins'     => 'python',
-                'socket'      => '/var/run/graphite-web/graphite-web.sock',
-                'stats'       => 
'/var/run/graphite-web/graphite-web-stats.sock',
+                'socket'      => '/run/uwsgi/graphite-web.sock',
+                'stats'       => '/run/uwsgi/graphite-web-stats.sock',
                 'wsgi-file'   => '/usr/share/graphite-web/graphite.wsgi',
                 'die-on-term' => true,
                 'master'      => true,
                 'processes'   => $uwsgi_processes,
             },
         },
-        require  => File['/var/run/graphite-web', '/var/log/graphite-web'],
+        require  => File['/var/log/graphite-web'],
     }
 
     file { '/usr/local/sbin/graphite-index':
diff --git a/modules/graphite/templates/graphite.nginx.erb 
b/modules/graphite/templates/graphite.nginx.erb
index 5eeb87b..2fc0828 100644
--- a/modules/graphite/templates/graphite.nginx.erb
+++ b/modules/graphite/templates/graphite.nginx.erb
@@ -2,7 +2,7 @@
 # This file is managed by Puppet
 
 upstream graphite_web {
-    server unix:/var/run/graphite-web/graphite-web.sock;
+    server unix:/run/uwsgi/graphite-web.sock;
 }
 
 server {
diff --git a/templates/apache/sites/gdash.wikimedia.org.erb 
b/templates/apache/sites/gdash.wikimedia.org.erb
index 4de0bbe..7a49588 100644
--- a/templates/apache/sites/gdash.wikimedia.org.erb
+++ b/templates/apache/sites/gdash.wikimedia.org.erb
@@ -7,6 +7,6 @@
         SetHandler uwsgi-handler
         uWSGIForceScriptName /
         uWSGImodifier1 7
-        uWSGIsocket /var/run/gdash/gdash.sock
+        uWSGIsocket /run/uwsgi/gdash.sock
     </Location>
 </VirtualHost>
diff --git a/templates/graphite/graphite.apache.erb 
b/templates/graphite/graphite.apache.erb
index 05fd7b5..5b32c59 100644
--- a/templates/graphite/graphite.apache.erb
+++ b/templates/graphite/graphite.apache.erb
@@ -10,7 +10,7 @@
 <%= @apache_auth -%>
 
         # uWSGI reverse-proxy
-        uWSGIsocket /var/run/graphite-web/graphite-web.sock
+        uWSGIsocket /run/uwsgi/graphite-web.sock
         SetHandler uwsgi-handler
     </Location>
 

-- 
To view, visit https://gerrit.wikimedia.org/r/133175
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2846330f7ca3438ae2d73448a5cdfccb6179f653
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Rush <r...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to