0

I faced with issue when some modules triggered refresh (service restart) for php-fpm even if nothing changed. For example:

==> 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

It is OK on vagrant/test environment but I don't want to restart fpm service on prod environment every time puppet running, so Is there any way to tell puppet do not restart php-fpm if nothing changed?

Thanks in advance for help!

P.S. Here is how puppet config looks like:

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
Serge
  • 21
  • 4
  • 2
    Your log shows that something _did_ change - new packages (extensions) were installed. If you want to remove the restart on change, show the manifest with the notify/subscribe. – Dominic Cleal Apr 20 '17 at 13:41
  • Yeah, but really **nothing** changed (I checked many times) and this drive me crazy. – Serge Apr 20 '17 at 13:49
  • 2
    Your log shows `[..] Package[php5.6-igbinary]/ensure: ensure changed 'purged' to 'present'`, which is a change. A package was uninstalled, and is now installed. Whatever manifest you have is then specifying this should refresh `php5.6-fpm`. If you think the package was already installed and this happens on every run, then please show this. – Dominic Cleal Apr 20 '17 at 14:10

1 Answers1

1

OK, looks like I've found why this happens: I have php version 5.6, so puppet tried to install packages with prefix php5.6, but for those 3 packages prefix is php-, so I added package_prefix for memcached, tideways and igbinary and now php-fpm is not restarted anymore.

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

Hope it will help someone else.

Cheers!

Serge
  • 21
  • 4