BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333564 )

Change subject: Use systemd for eventlogging::devserver and 
eventlogging::service
......................................................................

Use systemd for eventlogging::devserver and eventlogging::service

Bug: T154265
Change-Id: Ica8f5c4aa2038092a3c517ea50c5b9cc8db84a05
---
M puppet/modules/eventlogging/manifests/devserver.pp
M puppet/modules/eventlogging/manifests/service.pp
D puppet/modules/eventlogging/templates/devserver.upstart.erb
D puppet/modules/eventlogging/templates/service.upstart.erb
A puppet/modules/eventlogging/templates/systemd/eventlogging-devserver.erb
A puppet/modules/eventlogging/templates/systemd/eventlogging-service.erb
6 files changed, 29 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/64/333564/1

diff --git a/puppet/modules/eventlogging/manifests/devserver.pp 
b/puppet/modules/eventlogging/manifests/devserver.pp
index 42560ad..ecfd0dc 100644
--- a/puppet/modules/eventlogging/manifests/devserver.pp
+++ b/puppet/modules/eventlogging/manifests/devserver.pp
@@ -7,16 +7,8 @@
 
     # Local variable for ease of use in service.upstart.erb template.
     $eventlogging_path = $::eventlogging::path
-    file { '/etc/init/eventlogging-devserver.conf':
-        content => template('eventlogging/devserver.upstart.erb'),
-    }
 
     service { 'eventlogging-devserver':
-        ensure    => 'running',
-        enable    => true,
-        provider  => 'upstart',
-        subscribe => [
-            File['/etc/init/eventlogging-devserver.conf'],
-        ],
+        ensure    => 'present',
     }
 }
diff --git a/puppet/modules/eventlogging/manifests/service.pp 
b/puppet/modules/eventlogging/manifests/service.pp
index 4b5941c..fb78b1f 100644
--- a/puppet/modules/eventlogging/manifests/service.pp
+++ b/puppet/modules/eventlogging/manifests/service.pp
@@ -47,17 +47,11 @@
         content => template('eventlogging/service.erb'),
     }
 
-    file { "/etc/init/${service_name}.conf":
-        content => template('eventlogging/service.upstart.erb'),
-    }
-
-    service { $service_name:
-        ensure    => 'running',
-        enable    => true,
-        provider  => 'upstart',
-        subscribe => [
-            File[$config_file],
-            File["/etc/init/${service_name}.conf"],
-        ],
+    systemd::service { $service_name:
+        ensure         => 'present',
+        template_name  => 'eventlogging-service',
+        service_params => {
+            subscribe => File[$config_file],
+        },
     }
 }
diff --git a/puppet/modules/eventlogging/templates/devserver.upstart.erb 
b/puppet/modules/eventlogging/templates/devserver.upstart.erb
deleted file mode 100644
index 7b89c7f..0000000
--- a/puppet/modules/eventlogging/templates/devserver.upstart.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-#####################################################################
-### THIS FILE IS MANAGED BY PUPPET
-#####################################################################
-
-description "EventLogging Dev Server"
-
-start on web
-respawn
-
-setuid www-data
-setgid www-data
-
-exec <%= @eventlogging_path %>/virtualenv/bin/eventlogging-devserver 
--append-to <%= @output_file %>
diff --git a/puppet/modules/eventlogging/templates/service.upstart.erb 
b/puppet/modules/eventlogging/templates/service.upstart.erb
deleted file mode 100644
index baa0bcb..0000000
--- a/puppet/modules/eventlogging/templates/service.upstart.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-#####################################################################
-### THIS FILE IS MANAGED BY PUPPET
-#####################################################################
-
-description "EventLogging Produce HTTP Service"
-
-start on web
-respawn
-
-setuid www-data
-setgid www-data
-
-exec <%= @eventlogging_path %>/virtualenv/bin/eventlogging-service @<%= 
@config_file %>
diff --git 
a/puppet/modules/eventlogging/templates/systemd/eventlogging-devserver.erb 
b/puppet/modules/eventlogging/templates/systemd/eventlogging-devserver.erb
new file mode 100644
index 0000000..eb7532d
--- /dev/null
+++ b/puppet/modules/eventlogging/templates/systemd/eventlogging-devserver.erb
@@ -0,0 +1,11 @@
+[Unit]
+Description=EventLogging Dev Server
+Requires=network.target
+
+[service]
+User=www-data
+Group=www-data
+ExecStart=<%= @eventlogging_path %>/virtualenv/bin/eventlogging-devserver 
--append-to <%= @output_file %>
+
+[Install]
+WantedBy=multi-user.target
diff --git 
a/puppet/modules/eventlogging/templates/systemd/eventlogging-service.erb 
b/puppet/modules/eventlogging/templates/systemd/eventlogging-service.erb
new file mode 100644
index 0000000..0381fe0
--- /dev/null
+++ b/puppet/modules/eventlogging/templates/systemd/eventlogging-service.erb
@@ -0,0 +1,11 @@
+[Unit]
+Description=EventLogging Produce HTTP Service
+Requires=network.target
+
+[service]
+User=www-data
+Group=www-data
+ExecStart=<%= @eventlogging_path %>/virtualenv/bin/eventlogging-service @<%= 
@config_file %>
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica8f5c4aa2038092a3c517ea50c5b9cc8db84a05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to