Page MenuHomePhabricator

Fix config file handling for /etc/hhvm/php.ini
Closed, DeclinedPublic


Upgrading from the current HHVM packages to the most recent build resulted in an incomplete /etc/server/php.ini: it installs the minimal config shipped by upstream which doesn't contain the config stanzas for the luasandbox, wikidiff and tidy extensions:

jmm@mwdebug1002:~$ ls -la /etc/hhvm/server.ini
-r--r--r-- 1 root root 2070 Nov 22 13:15 /etc/hhvm/server.ini
jmm@mwdebug1002:~$ ls -la /etc/hhvm/php.ini
-r--r--r-- 1 root root 1122 Feb  6 10:10 /etc/hhvm/php.ini
jmm@mwdebug1002:~$ sudo apt-get install hhvm hhvm-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libboost-context1.55.0 libc-client2007e mlock
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
  hhvm hhvm-dbg
2 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.
Need to get 0 B/368 MB of archives.
After this operation, 30.8 MB disk space will be freed.
(Reading database ... 166968 files and directories currently installed.)
Preparing to unpack .../hhvm-dbg_3.12.11+dfsg-1+wmf2_amd64.deb ...
Unpacking hhvm-dbg (3.12.11+dfsg-1+wmf2) over (3.12.7+dfsg-1+wmf4) ...
Preparing to unpack .../hhvm_3.12.11+dfsg-1+wmf2_amd64.deb ...
Unpacking hhvm (3.12.11+dfsg-1+wmf2) over (3.12.7+dfsg-1+wmf4) ...
Processing triggers for systemd (215-17+deb8u5) ...
Processing triggers for man-db ( ...
Setting up hhvm (3.12.11+dfsg-1+wmf2) ...
Installing new version of config file /etc/default/hhvm ...
Installing new version of config file /etc/hhvm/php.ini ...

Configuration file '/etc/hhvm/server.ini'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** server.ini (Y/I/N/O/D/Z) [default=N] ? n
Setting up hhvm-dbg (3.12.11+dfsg-1+wmf2) ...
jmm@mwdebug1002:~$ ls -la /etc/hhvm/server.ini
-r--r--r-- 1 root root 2070 Nov 22 13:15 /etc/hhvm/server.ini
jmm@mwdebug1002:~$ ls -la /etc/hhvm/php.ini
-r--r--r-- 1 root root 184 Dec 17 03:14 /etc/hhvm/php.ini

After a puppet run:

jmm@mwdebug1002:~$ ls -la /etc/hhvm/server.ini
-r--r--r-- 1 root root 2070 Nov 22 13:15 /etc/hhvm/server.ini
jmm@mwdebug1002:~$ ls -la /etc/hhvm/php.ini
-r--r--r-- 1 root root 1122 Feb  6 10:36 /etc/hhvm/php.ini

Note that dpkg doesn't trigger a conffile prompt, and in fact the binary package of the previous build 3.12.7+dfsg-1+wmf4 build contains our extended config which we ship via puppet! :

jmm@mwdebug1001:~$ dpkg --status hhvm | grep php.ini
 /etc/hhvm/php.ini f13f0f43e0430338388042eb202bb481
jmm@mwdebug1001:~$ md5sum /etc/hhvm/php.ini
f13f0f43e0430338388042eb202bb481  /etc/hhvm/php.ini
jmm@mwdebug1001:~$ ls -la /etc/hhvm/php.ini
-r--r--r-- 1 root root 1122 Nov 22 13:11 /etc/hhvm/php.ini

I'm however not sure what caused this, the source package as found on copper only ships the default php.ini config (via hhvm.install).

Given that our HHVM package is not fully operational with the default upstream config, I think it would be best if we avoid /etc/hhvm/php.ini altogether. We should instead

  • write our custom config file to /etc/hhvm/wmf-php.ini via puppet
  • add a "AssertPathExists /etc/hhvm/wmf-php.ini" to our already custom hhvm systemd unit
  • and pass/etc/hhvm/wmf-php.ini to hhvm in the ExecStart.

Event Timeline

MoritzMuehlenhoff triaged this task as Low priority.

As long as we build our own HHVM packages, we can live without that, lowering priority. That was a problem in the package from which I originally updated, but all the new HHVM packages ship the correct default config.

Krinkle subscribed.

Obsolete per T229792.