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

Change subject: Migrate Varnish role from upstart to systemd
......................................................................

Migrate Varnish role from upstart to systemd

Bug: T154272
Change-Id: I77949e0b1c3fb41204b67adb0300db8915726a81
---
M puppet/modules/varnish/manifests/init.pp
A puppet/modules/varnish/templates/systemd.erb
D puppet/modules/varnish/templates/upstart.erb
3 files changed, 23 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/70/333870/1

diff --git a/puppet/modules/varnish/manifests/init.pp 
b/puppet/modules/varnish/manifests/init.pp
index 3583484..c73a697 100644
--- a/puppet/modules/varnish/manifests/init.pp
+++ b/puppet/modules/varnish/manifests/init.pp
@@ -218,15 +218,21 @@
         user    => 'root',
     }
 
-    file { '/etc/init/varnish.conf':
+    file { '/lib/systemd/system/varnish.service':
         ensure  => present,
-        content => template('varnish/upstart.erb'),
+        content => template('varnish/systemd.erb'),
         mode    => '0444',
+    }
+
+    exec { 'systemd reload for varnish':
+        refreshonly => true,
+        command     => '/bin/systemctl daemon-reload',
+        subscribe   => File['/lib/systemd/system/varnish.service'],
     }
 
     service { 'varnish':
         ensure    => running,
-        provider  => 'upstart',
+        provider  => 'systemd',
         require   => [
             Exec[
                 'build_varnish',
@@ -235,7 +241,6 @@
             ],
             File[
                 '/var/run/varnish',
-                '/etc/init/varnish.conf',
                 '/etc/varnish/secret',
                 '/usr/local/var/varnish/mediawiki-vagrant'
             ],
diff --git a/puppet/modules/varnish/templates/systemd.erb 
b/puppet/modules/varnish/templates/systemd.erb
new file mode 100644
index 0000000..974c522
--- /dev/null
+++ b/puppet/modules/varnish/templates/systemd.erb
@@ -0,0 +1,14 @@
+[Unit]
+Description=varnish service
+Requires=mediawiki-ready.service
+After=mediawiki-ready.service
+
+[Service]
+User=varnish
+Group=varnish
+SyslogIdentifier=varnish
+ExecStart=/usr/local/sbin/varnishd -a :6081 -T localhost:6082 -f 
/etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -F
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/puppet/modules/varnish/templates/upstart.erb 
b/puppet/modules/varnish/templates/upstart.erb
deleted file mode 100644
index da4e155..0000000
--- a/puppet/modules/varnish/templates/upstart.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-#####################################################################
-### THIS FILE IS MANAGED BY PUPPET
-#####################################################################
-
-description "Varnish"
-
-start on mediawiki-ready
-respawn
-
-setuid varnish
-setgid varnish
-
-exec /usr/local/sbin/varnishd -a :6081 -T localhost:6082 -f 
/etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -F
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77949e0b1c3fb41204b67adb0300db8915726a81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: jessie-migration
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