Ori.livneh has uploaded a new change for review.

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

Change subject: webperf: port services from upstart to systemd
......................................................................

webperf: port services from upstart to systemd

Change-Id: I7ffc28e985a2300e73987451f80fb120b57ced09
---
M modules/webperf/manifests/asset_check.pp
M modules/webperf/manifests/deprecate.pp
M modules/webperf/manifests/navtiming.pp
M modules/webperf/manifests/statsv.pp
M modules/webperf/manifests/ve.pp
D modules/webperf/templates/asset-check.conf.erb
A modules/webperf/templates/asset-check.systemd.erb
D modules/webperf/templates/deprecate.conf.erb
A modules/webperf/templates/deprecate.systemd.erb
D modules/webperf/templates/navtiming.conf.erb
A modules/webperf/templates/navtiming.systemd.erb
D modules/webperf/templates/ve.conf.erb
A modules/webperf/templates/ve.systemd.erb
13 files changed, 72 insertions(+), 107 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/85/250885/1

diff --git a/modules/webperf/manifests/asset_check.pp 
b/modules/webperf/manifests/asset_check.pp
index 7c8f0fa..5900ac1 100644
--- a/modules/webperf/manifests/asset_check.pp
+++ b/modules/webperf/manifests/asset_check.pp
@@ -32,8 +32,8 @@
         require => File['/srv/webperf/asset-check.js'],
     }
 
-    file { '/etc/init/asset-check.conf':
-        content => template('webperf/asset-check.conf.erb'),
+    file { '/lib/systemd/system/asset-check.service':
+        content => template('webperf/asset-check.systemd.erb'),
         notify  => Service['asset-check'],
         require => [
             File['/srv/webperf/asset-check.py'],
@@ -45,7 +45,7 @@
 
     service { 'asset-check':
         ensure   => running,
-        provider => 'upstart',
-        require  => File['/etc/init/asset-check.conf'],
+        provider => 'systemd',
+        require  => File['/lib/systemd/system/asset-check.service'],
     }
 }
diff --git a/modules/webperf/manifests/deprecate.pp 
b/modules/webperf/manifests/deprecate.pp
index 953de23..2283040 100644
--- a/modules/webperf/manifests/deprecate.pp
+++ b/modules/webperf/manifests/deprecate.pp
@@ -31,13 +31,13 @@
         notify => Service['statsd-mw-js-deprecate'],
     }
 
-    file { '/etc/init/statsd-mw-js-deprecate.conf':
-        content => template('webperf/deprecate.conf.erb'),
+    file { '/lib/systemd/system/statsd-mw-js-deprecate.service':
+        content => template('webperf/deprecate.systemd.erb'),
         notify  => Service['statsd-mw-js-deprecate'],
     }
 
     service { 'statsd-mw-js-deprecate':
         ensure   => running,
-        provider => upstart,
+        provider => systemd,
     }
 }
diff --git a/modules/webperf/manifests/navtiming.pp 
b/modules/webperf/manifests/navtiming.pp
index 178902d..1fca23f 100644
--- a/modules/webperf/manifests/navtiming.pp
+++ b/modules/webperf/manifests/navtiming.pp
@@ -31,13 +31,13 @@
         notify => Service['navtiming'],
     }
 
-    file { '/etc/init/navtiming.conf':
-        content => template('webperf/navtiming.conf.erb'),
+    file { '/lib/systemd/system/navtiming.service':
+        content => template('webperf/navtiming.systemd.erb'),
         notify  => Service['navtiming'],
     }
 
     service { 'navtiming':
         ensure   => running,
-        provider => upstart,
+        provider => systemd,
     }
 }
diff --git a/modules/webperf/manifests/statsv.pp 
b/modules/webperf/manifests/statsv.pp
index 7b4f954..13da62f 100644
--- a/modules/webperf/manifests/statsv.pp
+++ b/modules/webperf/manifests/statsv.pp
@@ -10,15 +10,15 @@
         provider => 'trebuchet',
     }
 
-    file { '/etc/init/statsv.conf':
+    file { '/lib/systemd/system/statsv.service':
         ensure  => present,
-        source  => 'puppet:///modules/webperf/statsv.conf',
+        source  => 'puppet:///modules/webperf/statsv.service',
         require => Package['statsv'],
         notify  => Service['statsv'],
     }
 
     service { 'statsv':
         ensure   => running,
-        provider => 'upstart',
+        provider => 'systemd',
     }
 }
diff --git a/modules/webperf/manifests/ve.pp b/modules/webperf/manifests/ve.pp
index 2d5f555..b42d601 100644
--- a/modules/webperf/manifests/ve.pp
+++ b/modules/webperf/manifests/ve.pp
@@ -29,13 +29,13 @@
         notify => Service['ve'],
     }
 
-    file { '/etc/init/ve.conf':
-        content => template('webperf/ve.conf.erb'),
+    file { '/lib/systemd/system/ve.service':
+        content => template('webperf/ve.systemd.erb'),
         notify  => Service['ve'],
     }
 
     service { 've':
         ensure   => running,
-        provider => upstart,
+        provider => systemd,
     }
 }
diff --git a/modules/webperf/templates/asset-check.conf.erb 
b/modules/webperf/templates/asset-check.conf.erb
deleted file mode 100644
index 54bcddb..0000000
--- a/modules/webperf/templates/asset-check.conf.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-# asset-check
-#
-# Upstart job configuration for asset-check.py
-#
-# This file is managed by Puppet.
-#
-description "Report static asset stats to StatsD"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid webperf
-setgid webperf
-
-respawn
-respawn limit 15 5
-
-chdir /srv/webperf
-exec /usr/bin/python /srv/webperf/asset-check.py \
-    <%= @endpoint %> \
-    --statsd-host <%= @statsd_host %> \
-    --statsd-port <%= @statsd_port %>
diff --git a/modules/webperf/templates/asset-check.systemd.erb 
b/modules/webperf/templates/asset-check.systemd.erb
new file mode 100644
index 0000000..91d15f2
--- /dev/null
+++ b/modules/webperf/templates/asset-check.systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description=asset-check
+After=network-online.target
+
+[Service]
+WorkingDirectory=/srv/webperf
+ExecStart=/usr/bin/python /srv/webperf/asset-check.py \
+    <%= @endpoint %> \
+    --statsd-host <%= @statsd_host %> \
+    --statsd-port <%= @statsd_port %>
+User=nobody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/modules/webperf/templates/deprecate.conf.erb 
b/modules/webperf/templates/deprecate.conf.erb
deleted file mode 100644
index bb2b4ff..0000000
--- a/modules/webperf/templates/deprecate.conf.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-# deprecate
-#
-# This is an Upstart job configuration file for a StatsD module.
-# See https://meta.wikimedia.org/wiki/Schema:DeprecatedUsage
-#
-# This file is managed by Puppet.
-#
-description "StatsD module for mw-js-deprecate"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid webperf
-setgid webperf
-
-respawn
-respawn limit 15 5
-
-chdir /srv/webperf
-exec /usr/bin/python /srv/webperf/deprecate.py \
-    <%= @endpoint %> \
-    --statsd-host <%= @statsd_host %> \
-    --statsd-port <%= @statsd_port %>
diff --git a/modules/webperf/templates/deprecate.systemd.erb 
b/modules/webperf/templates/deprecate.systemd.erb
new file mode 100644
index 0000000..ac6cffe
--- /dev/null
+++ b/modules/webperf/templates/deprecate.systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description=deprecate
+After=network-online.target
+
+[Service]
+WorkingDirectory=/srv/webperf
+ExecStart=/usr/bin/python /srv/webperf/deprecate.py \
+    <%= @endpoint %> \
+    --statsd-host <%= @statsd_host %> \
+    --statsd-port <%= @statsd_port %>
+User=nobody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/modules/webperf/templates/navtiming.conf.erb 
b/modules/webperf/templates/navtiming.conf.erb
deleted file mode 100644
index 7cbc6f1..0000000
--- a/modules/webperf/templates/navtiming.conf.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-# navtiming
-#
-# This is an Upstart job configuration file for a Graphite metric module for
-# NavigationTiming events. For more information, see:
-# https://meta.wikimedia.org/wiki/Schema:NavigationTiming
-# http://www.mediawiki.org/wiki/Extension:NavigationTiming
-#
-# This file is managed by Puppet.
-#
-description "NavigationTiming Graphite module"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid webperf
-setgid webperf
-
-respawn
-respawn limit 15 5
-
-chdir /srv/webperf
-exec /usr/bin/python /srv/webperf/navtiming.py \
-    <%= @endpoint %> \
-    --statsd-host <%= @statsd_host %> \
-    --statsd-port <%= @statsd_port %>
diff --git a/modules/webperf/templates/navtiming.systemd.erb 
b/modules/webperf/templates/navtiming.systemd.erb
new file mode 100644
index 0000000..549134f
--- /dev/null
+++ b/modules/webperf/templates/navtiming.systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description=navtiming
+After=network-online.target
+
+[Service]
+WorkingDirectory=/srv/webperf
+ExecStart=/usr/bin/python /srv/webperf/navtiming.py \
+    <%= @endpoint %> \
+    --statsd-host <%= @statsd_host %> \
+    --statsd-port <%= @statsd_port %>
+User=nobody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/modules/webperf/templates/ve.conf.erb 
b/modules/webperf/templates/ve.conf.erb
deleted file mode 100644
index 3c204ed..0000000
--- a/modules/webperf/templates/ve.conf.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-# navtiming
-#
-# This is an Upstart job configuration file for a Graphite metric module for
-# NavigationTiming events. For more information, see:
-# https://meta.wikimedia.org/wiki/Schema:NavigationTiming
-# http://www.mediawiki.org/wiki/Extension:NavigationTiming
-#
-# This file is managed by Puppet.
-#
-description "VisualEditor Graphite module"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-
-setuid webperf
-setgid webperf
-
-respawn
-respawn limit 15 5
-
-chdir /srv/webperf
-exec /usr/bin/python /srv/webperf/ve.py \
-    <%= @endpoint %> \
-    --statsd-host <%= @statsd_host %> \
-    --statsd-port <%= @statsd_port %>
diff --git a/modules/webperf/templates/ve.systemd.erb 
b/modules/webperf/templates/ve.systemd.erb
new file mode 100644
index 0000000..d534454
--- /dev/null
+++ b/modules/webperf/templates/ve.systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description=ve
+After=network-online.target
+
+[Service]
+WorkingDirectory=/srv/webperf
+ExecStart=/usr/bin/python /srv/webperf/ve.py \
+    <%= @endpoint %> \
+    --statsd-host <%= @statsd_host %> \
+    --statsd-port <%= @statsd_port %>
+User=nobody
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ffc28e985a2300e73987451f80fb120b57ced09
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to