manifest for fusioninventory-agent

77 views
Skip to first unread message

Stan

unread,
May 23, 2013, 10:32:59 AM5/23/13
to puppet...@googlegroups.com
Hi

I create a manifest for fusioninventory-agent on my puppet server

On my puppet client if i modify file /etc/sysconfig/fusioninventory-agent the file fusioninventory-agent replace by puppet server configuration (this is OK)

But if i stop fusioninventory-agent on my puppet client, puppet server not start the service and i don't know why

If you see an error in my configuration, say me

regards


class fusioninventory-agent::redhat {

package { 'fusioninventory-agent':
                 ensure => present,
        }

file { '/etc/sysconfig/fusioninventory-agent':
                        ensure => present,
                        owner => 'root',
                        group => 'root',
                        mode => 0644,
                        content => template("/etc/puppet/modules/fusioninventory-agent/templates/fusioninventory-agent.erb"),
                        require => Package["fusioninventory-agent"],
                        notify => Service["fusioninventory-agent"]
        }


service { 'fusioninventory-agent':
                        ensure => running,
                        hasstatus => true,
                        hasrestart => true,
                        enable => true,
                        require => File['/etc/sysconfig/fusioninventory-agent']
        }
}

Ellison Marks

unread,
May 23, 2013, 12:48:13 PM5/23/13
to puppet...@googlegroups.com
Could be that the status command isn't returning sane values. From the docs: http://docs.puppetlabs.com/references/latest/type.html#service

hasstatus
Declare whether the service’s init script has a functional status command; defaults to true. This attribute’s default value changed in Puppet 2.7.0.

The init script’s status command must return 0 if the service is running and a nonzero value otherwise. Ideally, these exit codes should conform to the LSB’s specification for init script status actions, but Puppet only considers the difference between 0 and nonzero to be relevant.

If a service’s init script does not support any kind of status command, you should set hasstatus to false and either provide a specific command using the status attribute or expect that Puppet will look for the service name in the process table. Be aware that ‘virtual’ init scripts (like ‘network’ under Red Hat systems) will respond poorly to refresh events from other resources if you override the default behavior without providing a status command. Valid values are true, false.

So you should manually check the return code of the status command from fusioninventory-agent's init script, to make sure it's conformant. If it's not, you'll have to set hasstatus to false and status to some reasonable command, as the docs mention.

Stan

unread,
May 24, 2013, 11:46:03 AM5/24/13
to puppet...@googlegroups.com
thanks a lot

i change my manifest with hasstatus false and it's ok!!!

service { 'fusioninventory-agent':
                        ensure => running,
                        hasstatus => false,
                        hasrestart => false,
Reply all
Reply to author
Forward
0 new messages