Kazor
2012-Dec-26 22:13 UTC
[Puppet Users] problem with restart a service when a file changes
Hello,
I have problem with my class when the archive is changed and the service is
not restarted when i apply change and run the puppet agent, I have the next
error:
[..............]
* err: /Stage[main]/Spam_rule/Exec[zmamavisdctl]: Failed to call refresh:
/opt/zimbra/bin/zmamavisdctl returned 1 instead of one of [0] at
/etc/puppet/modules/spam_rule/manifests/init.pp:25*
[..............]
Note: The change that i written in the archive (*
/etc/puppet//modules/spam_rule/99_rules.cf*) is applied to puppet agent the
problem is only refresh (restart) to resource.
My class is "spam_rule"
(/etc/puppet/modules/spam_rule/manifests/init.pp)
*
*
[..............]*
*
*class spam_rule {*
*
*
*if $TypeSrv == "zimbra" {*
*
*
*# global perms*
*File {*
* owner => zimbra,*
* group => zimbra,*
* mode => 644,*
*}*
*
*
*# create rule archive*
*file { "/opt/zimbra/conf/spamassassin/99_rule.cf":*
* ensure => file,*
* source => "puppet:///modules/spam_rule/99_rules.cf",*
* # notify => Exec["zmamavisdctl"],*
*}*
*
*
*
*
*# define the service to restart*
*exec { "zmamavisdctl":*
* refreshonly => true,*
* command => "/opt/zimbra/bin/zmamavisdctl",*
* subscribe =>
File["/opt/zimbra/conf/spamassassin/99_rules.cf"],*
*}*
*
*
*}*
*
*
*else{*
*
*
*# globals perms*
*File {*
* owner => mailcleaner,*
* group => mailcleaner,*
* mode => 644,*
*}*
*
*
*# create rules archive*
*file { "/usr/mailcleaner/share/spamassassin/99_rules.cf":*
* ensure => file,*
* source => "puppet:///modules/spam_rule/99_rules.cf",*
* }*
*
*
*# service restart*
*exec { "mailscanner":*
* refreshonly => true,*
* command => "/usr/mailcleaner/etc/init.d/mailscanner",*
* subscribe =>
File["/usr/mailcleaner/share/spamassassin/99_rules.cf"],*
*}*
*
*
*}*
* *
*}*
*
*
[..............]*
*
*My site.pp (/etc/puppet/manifests/)*
*
*
[..............]*
*
*
#all mailcleaner
server
*
node /^mailcleaner.*$/ {
$TypeSrv="mailcleaner"
include spam_rule
}
node ''mail.example.com'' {
$TypeSrv="zimbra"
include spam_rule
}
[..............]
¿Some suggestion?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/xUq8Wgn7jPIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
joe
2012-Dec-27 02:11 UTC
[Puppet Users] Re: problem with restart a service when a file changes
What it''s telling you is that the command it''s running (zmamavisdctl) is spitting out a return code of 1, which typically means that there was an error running the script. Either the command is actually failing, or the command is poorly written and does not provide the correct return code. This is not actually a problem with puppet at all. On Wednesday, December 26, 2012 3:13:44 PM UTC-7, Kazor wrote:> > Hello, > I have problem with my class when the archive is changed and the service > is not restarted when i apply change and run the puppet agent, I have the > next error: > > [..............] > * err: /Stage[main]/Spam_rule/Exec[zmamavisdctl]: Failed to call refresh: > /opt/zimbra/bin/zmamavisdctl returned 1 instead of one of [0] at > /etc/puppet/modules/spam_rule/manifests/init.pp:25* > [..............] > > Note: The change that i written in the archive (* > /etc/puppet//modules/spam_rule/99_rules.cf*) is applied to puppet agent > the problem is only refresh (restart) to resource. > > > My class is "spam_rule" (/etc/puppet/modules/spam_rule/manifests/init.pp) > * > * > [..............]* > * > *class spam_rule {* > * > * > *if $TypeSrv == "zimbra" {* > * > * > *# global perms* > *File {* > * owner => zimbra,* > * group => zimbra,* > * mode => 644,* > *}* > * > * > *# create rule archive* > *file { "/opt/zimbra/conf/spamassassin/99_rule.cf":* > * ensure => file,* > * source => "puppet:///modules/spam_rule/99_rules.cf",* > * # notify => Exec["zmamavisdctl"],* > *}* > * > * > * > * > *# define the service to restart* > *exec { "zmamavisdctl":* > * refreshonly => true,* > * command => "/opt/zimbra/bin/zmamavisdctl",* > * subscribe => File["/opt/zimbra/conf/spamassassin/99_rules.cf"],* > *}* > * > * > *}* > * > * > *else{* > * > * > *# globals perms* > *File {* > * owner => mailcleaner,* > * group => mailcleaner,* > * mode => 644,* > *}* > * > * > *# create rules archive* > *file { "/usr/mailcleaner/share/spamassassin/99_rules.cf":* > * ensure => file,* > * source => "puppet:///modules/spam_rule/99_rules.cf",* > * }* > * > * > *# service restart* > *exec { "mailscanner":* > * refreshonly => true,* > * command => "/usr/mailcleaner/etc/init.d/mailscanner",* > * subscribe => File["/usr/mailcleaner/share/spamassassin/99_rules.cf"], > * > *}* > * > * > *}* > * * > *}* > * > * > [..............]* > * > > > *My site.pp (/etc/puppet/manifests/)* > * > * > [..............]* > * > > * > > #all mailcleaner > server > * > node /^mailcleaner.*$/ { > $TypeSrv="mailcleaner" > include spam_rule > } > > node ''mail.example.com'' { > $TypeSrv="zimbra" > include spam_rule > > } > > [..............] > > ¿Some suggestion? > > > Thanks >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/xgmgCkLvGnkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Kazor
2012-Dec-28 13:21 UTC
[Puppet Users] Re: problem with restart a service when a file changes
Thaks Joe,
My problem was the sintax on command that was not correct, i solved this
and the agent running without problem.
[...........]
*# define the service to restart*
*exec { "zmamavisdctl":*
* user => ''zimbra'',*
* refreshonly => true,*
* command => ''/opt/zimbra/bin/zmantispamctl
restart'',*
* subscribe =>
File["/opt/zimbra/conf/spamassassin/99_spam_rules"],*
}
[...........]
Best regards!
El miércoles, 26 de diciembre de 2012 23:11:44 UTC-3, joe
escribió:>
> What it''s telling you is that the command it''s running
(zmamavisdctl) is
> spitting out a return code of 1, which typically means that there was an
> error running the script.
>
> Either the command is actually failing, or the command is poorly written
> and does not provide the correct return code.
>
> This is not actually a problem with puppet at all.
>
> On Wednesday, December 26, 2012 3:13:44 PM UTC-7, Kazor wrote:
>>
>> Hello,
>> I have problem with my class when the archive is changed and the
service
>> is not restarted when i apply change and run the puppet agent, I have
the
>> next error:
>>
>> [..............]
>> * err: /Stage[main]/Spam_rule/Exec[zmamavisdctl]: Failed to call
>> refresh: /opt/zimbra/bin/zmamavisdctl returned 1 instead of one of [0]
at
>> /etc/puppet/modules/spam_rule/manifests/init.pp:25*
>> [..............]
>>
>> Note: The change that i written in the archive (*
>> /etc/puppet//modules/spam_rule/99_rules.cf*) is applied to puppet agent
>> the problem is only refresh (restart) to resource.
>>
>>
>> My class is "spam_rule"
(/etc/puppet/modules/spam_rule/manifests/init.pp)
>> *
>> *
>> [..............]*
>> *
>> *class spam_rule {*
>> *
>> *
>> *if $TypeSrv == "zimbra" {*
>> *
>> *
>> *# global perms*
>> *File {*
>> * owner => zimbra,*
>> * group => zimbra,*
>> * mode => 644,*
>> *}*
>> *
>> *
>> *# create rule archive*
>> *file { "/opt/zimbra/conf/spamassassin/99_rule.cf":*
>> * ensure => file,*
>> * source => "puppet:///modules/spam_rule/99_rules.cf",*
>> * # notify => Exec["zmamavisdctl"],*
>> *}*
>> *
>> *
>> *
>> *
>> *# define the service to restart*
>> *exec { "zmamavisdctl":*
>> * refreshonly => true,*
>> * command => "/opt/zimbra/bin/zmamavisdctl",*
>> * subscribe =>
File["/opt/zimbra/conf/spamassassin/99_rules.cf"],*
>> *}*
>> *
>> *
>> *}*
>> *
>> *
>> *else{*
>> *
>> *
>> *# globals perms*
>> *File {*
>> * owner => mailcleaner,*
>> * group => mailcleaner,*
>> * mode => 644,*
>> *}*
>> *
>> *
>> *# create rules archive*
>> *file { "/usr/mailcleaner/share/spamassassin/99_rules.cf":*
>> * ensure => file,*
>> * source => "puppet:///modules/spam_rule/99_rules.cf",*
>> * }*
>> *
>> *
>> *# service restart*
>> *exec { "mailscanner":*
>> * refreshonly => true,*
>> * command =>
"/usr/mailcleaner/etc/init.d/mailscanner",*
>> * subscribe =>
File["/usr/mailcleaner/share/spamassassin/99_rules.cf
>> "],*
>> *}*
>> *
>> *
>> *}*
>> * *
>> *}*
>> *
>> *
>> [..............]*
>> *
>>
>>
>> *My site.pp (/etc/puppet/manifests/)*
>> *
>> *
>> [..............]*
>> *
>>
>> *
>>
>> #all mailcleaner
>> server
>> *
>> node /^mailcleaner.*$/ {
>> $TypeSrv="mailcleaner"
>> include spam_rule
>> }
>>
>> node ''mail.example.com'' {
>> $TypeSrv="zimbra"
>> include spam_rule
>>
>> }
>>
>> [..............]
>>
>> ¿Some suggestion?
>>
>>
>> Thanks
>>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/0thidrgtbPMJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.