jenkins-bot has submitted this change and it was merged.

Change subject: Set file permissions for hhbc cache files
......................................................................


Set file permissions for hhbc cache files

Bug: T89390
Change-Id: I08b3d5c709d02de4a0a5010da1651aa4cae4d390
---
M puppet/hieradata/common.yaml
M puppet/modules/hhvm/files/hhvm.conf
M puppet/modules/hhvm/manifests/init.pp
M puppet/modules/hhvm/templates/hhvm.default.erb
4 files changed, 31 insertions(+), 4 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  Mobrovac: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 062c80b..e45b0d8 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -22,7 +22,7 @@
   date:
     timezone: UTC
   include_path: .:/usr/share/php:/usr/share/pear
-  pid: /var/run/hhvm/hhvm.pid
+  pid: "%{hiera('hhvm::hhbc_dir')}/hhvm.pid"
   hhvm:
     server:
       type: fastcgi
@@ -60,7 +60,7 @@
       translate_source: true
     repo:
       central:
-        path: /var/run/hhvm/hhvm.hhbc
+        path: "%{hiera('hhvm::hhbc_dir')}/hhvm.hhbc"
       local:
         mode: --
     enable_obj_destruct_call: true
@@ -89,13 +89,14 @@
     jit: true
     repo:
       central:
-        path: /var/run/hhvm/fcgi.hhbc.sq3
+        path: "%{hiera('hhvm::hhbc_dir')}/fcgi.hhbc.sq3"
     xdebug-not-done:
       enable: 1
       remote_connect_back: 1
       remote_enable: 1
 
 hhvm::logroot: /vagrant/logs
+hhvm::hhbc_dir: /var/run/hhvm
 
 kibana::deploy_dir: /srv/kibana
 kibana::default_route: /dashboard/elasticsearch/default
diff --git a/puppet/modules/hhvm/files/hhvm.conf 
b/puppet/modules/hhvm/files/hhvm.conf
index 45c6d24..fcb6b80 100644
--- a/puppet/modules/hhvm/files/hhvm.conf
+++ b/puppet/modules/hhvm/files/hhvm.conf
@@ -29,7 +29,7 @@
   . /etc/default/hhvm
   exec /sbin/start-stop-daemon --quiet --start \
     --chuid "${HHVM_USER:-www-data}:${HHVM_GROUP:-www-data}" \
-    --make-pidfile --pidfile "${HHVM_RUN_DIR:-/run/hhvm}/hhvm.pid" \
+    --make-pidfile --pidfile "${HHVM_RUN_DIR:-/var/run/hhvm}/hhvm.pid" \
     --chdir "${HHVM_TMP_DIR:-/var/tmp/hhvm}" \
     --startas /usr/bin/hhvm -- \
       --config "${HHVM_CONFIG_DIR:-/etc/hhvm}/fcgi.ini" \
diff --git a/puppet/modules/hhvm/manifests/init.pp 
b/puppet/modules/hhvm/manifests/init.pp
index 4318d0d..2ca3103 100644
--- a/puppet/modules/hhvm/manifests/init.pp
+++ b/puppet/modules/hhvm/manifests/init.pp
@@ -36,10 +36,14 @@
 #   made here to store access and error logs and core dumps . (eg /var/log or
 #   /vagrant/logs)
 #
+# [*hhbc_dir*]
+#   Parent directory to store shared hhbc bytecode cache files in.
+#
 class hhvm (
   $common_settings,
   $fcgi_settings,
   $logroot,
+  $hhbc_dir,
 ) {
     include ::apache
     include ::apache::mod::proxy_fcgi
@@ -105,6 +109,27 @@
         notify  => Service['hhvm'],
     }
 
+    file { $hhbc_dir:
+        ensure => directory,
+        owner  => 'www-data',
+        group  => 'www-data',
+        mode   => '0755',
+    }
+
+    file { $common_settings['hhvm']['repo']['central']['path']:
+        ensure => file,
+        owner  => 'www-data',
+        group  => 'www-data',
+        mode   => '0666',
+    }
+
+    file { $fcgi_settings['hhvm']['repo']['central']['path']:
+        ensure => file,
+        owner  => 'www-data',
+        group  => 'www-data',
+        mode   => '0644',
+    }
+
     service { 'hhvm':
         ensure   => running,
         provider => upstart,
diff --git a/puppet/modules/hhvm/templates/hhvm.default.erb 
b/puppet/modules/hhvm/templates/hhvm.default.erb
index b0ae76e..8d14a31 100644
--- a/puppet/modules/hhvm/templates/hhvm.default.erb
+++ b/puppet/modules/hhvm/templates/hhvm.default.erb
@@ -2,3 +2,4 @@
 # This file is managed by Puppet.
 
 HHVM_LOG_DIR="<%= @logroot %>/hhvm"
+HHVM_RUN_DIR="<%= @hhbc_dir %>"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I08b3d5c709d02de4a0a5010da1651aa4cae4d390
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to