git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #19264 from peterhoeg/php

php fpm: add systemd support

commit92d2416280f1d8289b67b240bee5ab187577067f authorDomen Kožar <domen@dev.si> dateWed 5 Oct 2016, 17:36 (10 years ago) parent1bd8d775a6626f
2 files changed+7−9
nixos/modules/services/web-servers/phpfpm/default.nix+3−6 pkgs/development/interpreters/php/default.nix+4−3
nixos/modules/services/web-servers/phpfpm/default.nix+3−6
@@ -7,8 +7,6 @@ let
77
88 stateDir = "/run/phpfpm";
99
10− pidFile = "${stateDir}/phpfpm.pid";
11−
1210 mkPool = n: p: ''
1311 [${n}]
1412 listen = ${p.listen}
@@ -17,9 +15,8 @@ let
1715
1816 cfgFile = pkgs.writeText "phpfpm.conf" ''
1917 [global]
20− pid = ${pidFile}
2118 error_log = syslog
22− daemonize = yes
19+ daemonize = no
2320 ${cfg.extraConfig}
2421
2522 ${concatStringsSep "\n" (mapAttrsToList mkPool cfg.pools)}
@@ -43,7 +40,7 @@ in {
4340 description = ''
4441 Extra configuration that should be put in the global section of
4542 the PHP-FPM configuration file. Do not specify the options
46− <literal>pid</literal>, <literal>error_log</literal> or
43+ <literal>error_log</literal> or
4744 <literal>daemonize</literal> here, since they are generated by
4845 NixOS.
4946 '';
@@ -129,8 +126,8 @@ in {
129126 mkdir -p "${stateDir}"
130127 '';
131128 serviceConfig = {
129+ Type = "notify";
132130 ExecStart = "${cfg.phpPackage}/bin/php-fpm -y ${cfgFile} -c ${phpIni}";
133− PIDFile = pidFile;
134131 };
135132 };
136133
pkgs/development/interpreters/php/default.nix+4−3
@@ -2,7 +2,7 @@
22, mysql, libxml2, readline, zlib, curl, postgresql, gettext
33, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
44, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
5−, uwimap, pam, gmp, apacheHttpd, libiconv }:
5+, uwimap, pam, gmp, apacheHttpd, libiconv, systemd }:
66
77let
88
@@ -19,11 +19,12 @@ let
1919
2020 enableParallelBuilding = true;
2121
22− buildInputs = [ flex bison pkgconfig ];
22+ buildInputs = [ flex bison pkgconfig systemd ];
2323
2424 configureFlags = [
2525 "EXTENSION_DIR=$(out)/lib/php/extensions"
26− ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}";
26+ ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}"
27+ ++ lib.optional stdenv.isLinux "--with-fpm-systemd";
2728
2829 flags = {
2930