Gilles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315635

Change subject: Make Swift logs more accessible
......................................................................

Make Swift logs more accessible

Bug: T147918
Change-Id: Ic6c70a1ac5bf69ddeba09465be345e6454706c15
---
M puppet/modules/swift/manifests/init.pp
M puppet/modules/swift/manifests/service.pp
M puppet/modules/swift/templates/proxy-server.conf.erb
A puppet/modules/swift/templates/rsyslog.conf.erb
M puppet/modules/swift/templates/upstart.erb
5 files changed, 29 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/35/315635/1

diff --git a/puppet/modules/swift/manifests/init.pp 
b/puppet/modules/swift/manifests/init.pp
index 722a8e7..fa74445 100644
--- a/puppet/modules/swift/manifests/init.pp
+++ b/puppet/modules/swift/manifests/init.pp
@@ -134,72 +134,72 @@
         require     => Package['swift-container'],
     }
 
-    swift::service { 'swift-account-server':
+    swift::service { 'account-server':
         cfg_file => $account_cfg_file,
         require  => Ring[$account_cfg_file],
     }
 
-    swift::service { 'swift-account-auditor':
+    swift::service { 'account-auditor':
         cfg_file => $account_cfg_file,
         require  => Ring[$account_cfg_file],
     }
 
-    swift::service { 'swift-account-reaper':
+    swift::service { 'account-reaper':
         cfg_file => $account_cfg_file,
         require  => Ring[$account_cfg_file],
     }
 
-    swift::service { 'swift-account-replicator':
+    swift::service { 'account-replicator':
         cfg_file => $account_cfg_file,
         require  => Ring[$account_cfg_file],
     }
 
-    swift::service { 'swift-container-server':
+    swift::service { 'container-server':
         cfg_file => $container_cfg_file,
         require  => Ring[$container_cfg_file],
     }
 
-    swift::service { 'swift-container-auditor':
+    swift::service { 'container-auditor':
         cfg_file => $container_cfg_file,
         require  => Ring[$container_cfg_file],
     }
 
-    swift::service { 'swift-container-replicator':
+    swift::service { 'container-replicator':
         cfg_file => $container_cfg_file,
         require  => Ring[$container_cfg_file],
     }
 
-    swift::service { 'swift-container-sync':
+    swift::service { 'container-sync':
         cfg_file => $container_cfg_file,
         require  => Ring[$container_cfg_file],
     }
 
-    swift::service { 'swift-container-updater':
+    swift::service { 'container-updater':
         cfg_file => $container_cfg_file,
         require  => Ring[$container_cfg_file],
     }
 
-    swift::service { 'swift-object-server':
+    swift::service { 'object-server':
         cfg_file => $object_cfg_file,
         require  => Ring[$object_cfg_file],
     }
 
-    swift::service { 'swift-object-auditor':
+    swift::service { 'object-auditor':
         cfg_file => $object_cfg_file,
         require  => Ring[$object_cfg_file],
     }
 
-    swift::service { 'swift-object-replicator':
+    swift::service { 'object-replicator':
         cfg_file => $object_cfg_file,
         require  => Ring[$object_cfg_file],
     }
 
-    swift::service { 'swift-object-updater':
+    swift::service { 'object-updater':
         cfg_file => $object_cfg_file,
         require  => Ring[$object_cfg_file],
     }
 
-    swift::service { 'swift-proxy-server':
+    swift::service { 'proxy-server':
         cfg_file  => $proxy_cfg_file,
         require   => File['/usr/local/lib/python2.7/dist-packages/wmf/'],
         subscribe => File['/usr/local/lib/python2.7/dist-packages/wmf/'],
diff --git a/puppet/modules/swift/manifests/service.pp 
b/puppet/modules/swift/manifests/service.pp
index 2646142..039c211 100644
--- a/puppet/modules/swift/manifests/service.pp
+++ b/puppet/modules/swift/manifests/service.pp
@@ -16,17 +16,22 @@
 define swift::service(
     $cfg_file,
 ) {
-    file { "/etc/init/${title}.conf":
+    file { "/etc/init/swift-${title}.conf":
         ensure  => present,
         content => template('swift/upstart.erb'),
         mode    => '0444',
     }
 
-    service { $title:
+    service { "swift-${title}":
         ensure    => running,
         enable    => true,
         provider  => 'upstart',
         subscribe => File[$cfg_file],
-        require   => File[$cfg_file, "/etc/init/${title}.conf"],
+        require   => File[$cfg_file, "/etc/init/swift-${title}.conf"],
+    }
+
+    rsyslog::conf { "rsyslog-swift-${title}":
+        content  => template('swift/rsyslog.conf.erb'),
+        priority => 40,
     }
 }
\ No newline at end of file
diff --git a/puppet/modules/swift/templates/proxy-server.conf.erb 
b/puppet/modules/swift/templates/proxy-server.conf.erb
index 93b6382..21cbbf4 100644
--- a/puppet/modules/swift/templates/proxy-server.conf.erb
+++ b/puppet/modules/swift/templates/proxy-server.conf.erb
@@ -4,7 +4,6 @@
 
 [DEFAULT]
 bind_port = <%= @port %>
-log_facility = LOG_LOCAL0
 log_level = DEBUG
 
 [pipeline:main]
diff --git a/puppet/modules/swift/templates/rsyslog.conf.erb 
b/puppet/modules/swift/templates/rsyslog.conf.erb
new file mode 100644
index 0000000..f3ae80e
--- /dev/null
+++ b/puppet/modules/swift/templates/rsyslog.conf.erb
@@ -0,0 +1,5 @@
+# rsyslog configuration for Swift <%= @title %>
+# This file is managed by Puppet
+
+:programname, isequal, "<%= @title %>" /vagrant/logs/swift/<%= @title %>.log
+& ~
diff --git a/puppet/modules/swift/templates/upstart.erb 
b/puppet/modules/swift/templates/upstart.erb
index 338d57a..e3dc7d2 100644
--- a/puppet/modules/swift/templates/upstart.erb
+++ b/puppet/modules/swift/templates/upstart.erb
@@ -2,9 +2,9 @@
 ### THIS FILE IS MANAGED BY PUPPET
 #####################################################################
 
-description "<%= @title %>"
+description "swift-<%= @title %>"
 
 start on mediawiki-ready
 respawn
 
-exec /usr/bin/<%= @title %> <%= @cfg_file %>
\ No newline at end of file
+exec /usr/bin/swift-<%= @title %> <%= @cfg_file %>
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6c70a1ac5bf69ddeba09465be345e6454706c15
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles <gdu...@wikimedia.org>

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

Reply via email to