puppet can't get the right service status from centos5.3

52 views
Skip to first unread message

li jackie

unread,
Aug 14, 2014, 6:06:49 AM8/14/14
to puppet...@googlegroups.com

when i disable puppet service ,centos5.3 system always have change: " Notice: /Stage[main]/Puppet/Service[puppet]/ensure: ensure changed 'running' to 'stopped' Notice: Finished catalog run in 1.15 seconds"

just say the code :

[root@xen-21206-vm02 ~]# puppet resource service puppet -d

Debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist
Debug: Puppet::Type::Service::ProviderOpenrc: file /sbin/rc-service does not exist
Debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist
Debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist
Debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does not exist
Debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
Debug: Puppet::Type::Service::ProviderSystemd: file systemctl does not exist
Debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist
Debug: Puppet::Type::Service::ProviderOpenrc: file /sbin/rc-service does not exist
Debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist
Debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist
Debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does not exist
Debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
Debug: Puppet::Type::Service::ProviderSystemd: file systemctl does not exist
Debug: Executing '/sbin/service puppet status'
Debug: Executing '/sbin/chkconfig puppet'


service { 'puppet':
  ensure => 'running',
  enable => 'false',
}


[root@xen-21206-vm02 ~]# /sbin/service puppet status
puppet is stopped
[root@xen-21206-vm02 ~]# echo $?
3

this agent get the wrong service status.should

service { 'puppet':
  ensure => 'stopped',
  enable => 'false',
}

who can help me?

thks


my puppet version   :  3.2.3

David Schmitt

unread,
Aug 14, 2014, 6:31:27 AM8/14/14
to puppet...@googlegroups.com
The init script on 5 only checks for running puppet processes. "puppet
resource" is a puppet process. Therefore the init script thinks the
service is running.

Solution: use Service#pattern to match bettern on the process name.



Regards, David
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/df4ac6b9-c8b2-47ed-8f12-e45b00030b6e%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/df4ac6b9-c8b2-47ed-8f12-e45b00030b6e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
* Always looking for people I can help with awesome projects *
G+: https://plus.google.com/+DavidSchmitt
Blog: http://club.black.co.at/log/
LinkedIn: http://at.linkedin.com/in/davidschmitt

li jackie

unread,
Aug 15, 2014, 2:10:57 AM8/15/14
to puppet...@googlegroups.com
thank you David~

I changed some config,and  it work fine~

service { 'puppet':
  ensure => 'running',
  enable => 'false',
}

changed

service { 'puppet':
  ensure => 'running',
  enable => 'false',
  hasstatus => 'false',
  status => '/etc/init.d/puppet status'
}

as you said  .  if the service not running,  in 5 ,the status script won't work,the puppet think the service are running .and then run stop script,and the report will always print the change info




在 2014年8月14日星期四UTC+8下午6时31分27秒,David Schmitt写道:
Reply all
Reply to author
Forward
0 new messages