0

当某些模块触发 php-fpm 的刷新(服务重启)时,即使没有任何改变,我也遇到了问题。例如:

==> app-server: Notice: /Stage[main]/Php/Php::Extension[igbinary]/Package[php5.6-igbinary]/ensure: ensure changed 'purged' to 'present'
==> app-server: Notice: /Stage[main]/Php/Php::Extension[memcached]/Package[php5.6-memcached]/ensure: ensure changed 'purged' to 'latest'
==> app-server: Info: Php::Extension[memcached]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Notice: /Stage[main]/Php/Php::Extension[tideways]/Package[php5.6-tideways]/ensure: ensure changed 'purged' to 'present'
==> app-server: Info: Php::Extension[tideways]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Info: Php::Extension[igbinary]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Notice: /Stage[main]/Php::Fpm::Service/Service[php5.6-fpm]: Triggered 'refresh' from 3 events

在 vagrant/test 环境下可以,但我不想每次 puppet 运行时都在 prod 环境中重新启动 fpm 服务,所以有没有办法告诉 puppet 如果没有任何变化就不要重新启动 php-fpm?

提前感谢您的帮助!

PS 下面是 puppet 配置的样子:

php::globals::php_version: '5.6'
php::extensions:
xml: {}
curl: {}
json: {}
intl: {}
mbstring: {}
mcrypt: {}
mysql: {}
curl: {}
intl: {}
json: {}
odbc: {}
readline: {}
igbinary: {}
zip: {}
soap: {}
dba: {}
bz2: {}
tideways: {}
memcached: {}
oci8:
  provider: pecl
  ensure: '2.0.12'
pgsql: {}
mcrypt: {}
gd: {}
apcu:
  provider: pecl
  ensure: '4.0.11'
  settings:
    apc.stat: 1
    apc.stat_ctime: 1
4

1 回答 1

1

好的,看起来我找到了发生这种情况的原因:我有 php 版本 5.6,所以 puppet 尝试安装前缀为 php5.6 的包,但是对于这 3 个包的前缀是php-,所以我为 memcached、tideways 和 igbinary 添加了 package_prefix现在 php-fpm 不再重新启动。

tideways:
    package_prefix: php-
igbinary:
    package_prefix: php-
memcached:
    package_prefix: php-

希望它会帮助别人。

干杯!

于 2017-04-20T14:13:42.390 回答