[Puppet - Bug #23319] Unnecessary service restart when service is down and we set ensure = running and subscribe the service to some file(s) in puppet-2.7

2013-12-04 Thread tickets

Issue #23319 has been updated by Alex D.


OK, thanks for the info. I'm not using EPEL, this issue with service 
refresh/restart exists in puppet-2.7.23 installed from puppetlabs repo:

pre
# puppet --version
2.7.23
/pre

pre
# rpm -qi puppet
Name: puppet   Relocations: (not relocatable)
Version : 2.7.23Vendor: Puppet Labs
Release : 1.el6 Build Date: Wed 14 Aug 2013 
09:44:16 PM UTC
Install Date: Wed 04 Dec 2013 11:04:08 AM UTC  Build Host: rpm-builder-5
Group   : System Environment/Base   Source RPM: 
puppet-2.7.23-1.el6.src.rpm
Size: 3357077  License: ASL 2.0
Signature   : RSA/SHA1, Thu 15 Aug 2013 02:10:55 PM UTC, Key ID 1054b7a24bd6ec30
URL : http://puppetlabs.com
Summary : A network tool for managing many disparate systems
/pre


Bug #23319: Unnecessary service restart when service is down and we set ensure 
= running and subscribe the service to some file(s) in puppet-2.7
https://projects.puppetlabs.com/issues/23319#change-100989

* Author: Alex D
* Status: Duplicate
* Priority: High
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 

Steps to reproduce:

1) create test.pp file:
pre
service {
nginx:
ensure  = running,
enable  = true,
subscribe   = File[/tmp/test1];
}
file {
/tmp/test1:
ensure  = file,
content = kasjakjksjjks;
}
/pre

2) Install nginx and set error_log level to info

3) Make sure nginx is down and  /tmp/test1 file does not exist:
pre
service nginx stop
rm -f /tmp/test1
/pre

4) Apply the test.pp file:
pre
puppet apply test.pp
/pre


Result: puppet brings nginx service up and then restarts it.

Result in stdout:
pre
notice: /Stage[main]//File[/tmp/test1]/ensure: defined content as 
'{md5}502675e3d4e9692deb2e3b2e262450c1'
notice: /Stage[main]//Service[nginx]/ensure: ensure changed 'stopped' to 
'running'
notice: /Stage[main]//Service[nginx]: Triggered 'refresh' from 1 events
/pre

Result in nginx log:
pre
2013/11/29 16:44:38 [notice] 3900#0: using the epoll event method
2013/11/29 16:44:38 [notice] 3900#0: nginx/1.0.15
2013/11/29 16:44:38 [notice] 3900#0: built by gcc 4.4.7 20120313 (Red Hat 
4.4.7-3) (GCC) 
2013/11/29 16:44:38 [notice] 3900#0: OS: Linux 
2.6.32-358.123.2.openstack.el6.x86_64
2013/11/29 16:44:38 [notice] 3900#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2013/11/29 16:44:38 [notice] 3901#0: start worker processes
2013/11/29 16:44:38 [notice] 3901#0: start worker process 3904
2013/11/29 16:44:38 [notice] 3901#0: signal 15 (SIGTERM) received, exiting
2013/11/29 16:44:38 [notice] 3904#0: exiting
2013/11/29 16:44:38 [notice] 3904#0: exit
2013/11/29 16:44:38 [notice] 3901#0: signal 17 (SIGCHLD) received
2013/11/29 16:44:38 [notice] 3901#0: worker process 3904 exited with code 0
2013/11/29 16:44:38 [notice] 3901#0: exit
2013/11/29 16:44:38 [notice] 3940#0: using the epoll event method
2013/11/29 16:44:38 [notice] 3940#0: nginx/1.0.15
2013/11/29 16:44:38 [notice] 3940#0: built by gcc 4.4.7 20120313 (Red Hat 
4.4.7-3) (GCC) 
2013/11/29 16:44:38 [notice] 3940#0: OS: Linux 
2.6.32-358.123.2.openstack.el6.x86_64
2013/11/29 16:44:38 [notice] 3940#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2013/11/29 16:44:38 [notice] 3941#0: start worker processes
2013/11/29 16:44:38 [notice] 3941#0: start worker process 3943
/pre

Strace:
pre
2912  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, status], [/* 28 vars */]) = 0
2912  execve(/etc/init.d/nginx, [/etc/init.d/nginx, status], [/* 2 vars 
*/]) = 0
2926  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, start], [/* 28 vars */]) = 0
2926  execve(/etc/init.d/nginx, [/etc/init.d/nginx, start], [/* 2 vars 
*/]) = 0
2945  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, status], [/* 28 vars */]) = 0
2945  execve(/etc/init.d/nginx, [/etc/init.d/nginx, status], [/* 2 vars 
*/]) = 0
2954  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, stop], [/* 28 vars */]) = 0
2954  execve(/etc/init.d/nginx, [/etc/init.d/nginx, stop], [/* 2 vars 
*/]) = 0
2966  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, start], [/* 28 vars */]) = 0
2966  execve(/etc/init.d/nginx, [/etc/init.d/nginx, start], [/* 2 vars 
*/]) = 0
/pre

Such behavior may break some services deployment (cluster services that start 
to synchronize on the first start and then get stopped/started again).


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 

[Puppet - Bug #23319] Unnecessary service restart when service is down and we set ensure = running and subscribe the service to some file(s) in puppet-2.7

2013-11-30 Thread tickets

Issue #23319 has been updated by Alex D.


Under puppet-3.3 it works as expected - it brings the server up once without 
restarts:

pre
Notice: /Stage[main]//File[/tmp/test1]/ensure: defined content as 
'{md5}502675e3d4e9692deb2e3b2e262450c1'
Notice: /Stage[main]//Service[nginx]/ensure: ensure changed 'stopped' to 
'running'
Notice: Finished catalog run in 0.44 seconds
/pre

Nginx log:
pre
2013/11/29 16:46:31 [notice] 4605#0: using the epoll event method
2013/11/29 16:46:31 [notice] 4605#0: nginx/1.0.15
2013/11/29 16:46:31 [notice] 4605#0: built by gcc 4.4.7 20120313 (Red Hat 
4.4.7-3) (GCC)
2013/11/29 16:46:31 [notice] 4605#0: OS: Linux 
2.6.32-358.123.2.openstack.el6.x86_64
2013/11/29 16:46:31 [notice] 4605#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2013/11/29 16:46:31 [notice] 4606#0: start worker processes
2013/11/29 16:46:31 [notice] 4606#0: start worker process 4608
/pre


Bug #23319: Unnecessary service restart when service is down and we set ensure 
= running and subscribe the service to some file(s) in puppet-2.7
https://projects.puppetlabs.com/issues/23319#change-100269

* Author: Alex D
* Status: Unreviewed
* Priority: High
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 

Steps to reproduce:

1) create test.pp file:
pre
service {
nginx:
ensure  = running,
enable  = true,
subscribe   = File[/tmp/test1];
}
file {
/tmp/test1:
ensure  = file,
content = kasjakjksjjks;
}
/pre

2) Install nginx and set error_log level to info

3) Make sure nginx is down and  /tmp/test1 file does not exist:
pre
service nginx stop
rm -f /tmp/test1
/pre

4) Apply the test.pp file:
pre
puppet apply test.pp
/pre


Result: puppet brings nginx service up and then restarts it.

Result in stdout:
pre
notice: /Stage[main]//File[/tmp/test1]/ensure: defined content as 
'{md5}502675e3d4e9692deb2e3b2e262450c1'
notice: /Stage[main]//Service[nginx]/ensure: ensure changed 'stopped' to 
'running'
notice: /Stage[main]//Service[nginx]: Triggered 'refresh' from 1 events
/pre

Result in nginx log:
pre
2013/11/29 16:44:38 [notice] 3900#0: using the epoll event method
2013/11/29 16:44:38 [notice] 3900#0: nginx/1.0.15
2013/11/29 16:44:38 [notice] 3900#0: built by gcc 4.4.7 20120313 (Red Hat 
4.4.7-3) (GCC) 
2013/11/29 16:44:38 [notice] 3900#0: OS: Linux 
2.6.32-358.123.2.openstack.el6.x86_64
2013/11/29 16:44:38 [notice] 3900#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2013/11/29 16:44:38 [notice] 3901#0: start worker processes
2013/11/29 16:44:38 [notice] 3901#0: start worker process 3904
2013/11/29 16:44:38 [notice] 3901#0: signal 15 (SIGTERM) received, exiting
2013/11/29 16:44:38 [notice] 3904#0: exiting
2013/11/29 16:44:38 [notice] 3904#0: exit
2013/11/29 16:44:38 [notice] 3901#0: signal 17 (SIGCHLD) received
2013/11/29 16:44:38 [notice] 3901#0: worker process 3904 exited with code 0
2013/11/29 16:44:38 [notice] 3901#0: exit
2013/11/29 16:44:38 [notice] 3940#0: using the epoll event method
2013/11/29 16:44:38 [notice] 3940#0: nginx/1.0.15
2013/11/29 16:44:38 [notice] 3940#0: built by gcc 4.4.7 20120313 (Red Hat 
4.4.7-3) (GCC) 
2013/11/29 16:44:38 [notice] 3940#0: OS: Linux 
2.6.32-358.123.2.openstack.el6.x86_64
2013/11/29 16:44:38 [notice] 3940#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2013/11/29 16:44:38 [notice] 3941#0: start worker processes
2013/11/29 16:44:38 [notice] 3941#0: start worker process 3943
/pre

Strace:
pre
2912  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, status], [/* 28 vars */]) = 0
2912  execve(/etc/init.d/nginx, [/etc/init.d/nginx, status], [/* 2 vars 
*/]) = 0
2926  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, start], [/* 28 vars */]) = 0
2926  execve(/etc/init.d/nginx, [/etc/init.d/nginx, start], [/* 2 vars 
*/]) = 0
2945  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, status], [/* 28 vars */]) = 0
2945  execve(/etc/init.d/nginx, [/etc/init.d/nginx, status], [/* 2 vars 
*/]) = 0
2954  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, stop], [/* 28 vars */]) = 0
2954  execve(/etc/init.d/nginx, [/etc/init.d/nginx, stop], [/* 2 vars 
*/]) = 0
2966  execve(/bin/env, [env, -i, PATH=/sbin:/usr/sbin:/bin:/usr/bin, 
TERM=screen, /etc/init.d/nginx, start], [/* 28 vars */]) = 0
2966  execve(/etc/init.d/nginx, [/etc/init.d/nginx, start], [/* 2 vars 
*/]) = 0
/pre

Such behavior may break some services deployment (cluster services that start 
to synchronize on the first start and then get stopped/started again).


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: