FAQ
Hello all,

Can anyone please help, every time I push a config to my hosts, the windows
service I have just defined keeps stopping and starting, and logging in the
eventlog,

I only want the service to stop and start, if something has changed, and to
my knowledge nothing has changed ? so it should stay running ?

Can some one please help or explain

regards

James

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Josh Cooper at Feb 7, 2013 at 4:24 pm
    Hi Jim,
    On Thu, Feb 7, 2013 at 7:15 AM, jim wrote:
    Hello all,

    Can anyone please help, every time I push a config to my hosts, the windows
    service I have just defined keeps stopping and starting, and logging in the
    eventlog,

    I only want the service to stop and start, if something has changed, and to
    my knowledge nothing has changed ? so it should stay running ?

    Can some one please help or explain

    regards

    James

    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
    From http://docs.puppetlabs.com/references/latest/type.html#service,
    "Note that if a service receives an event from another resource, the
    service will get restarted."

    Can you post your manifest? Sounds like your service is subscribed to
    some other resource, perhaps a package whose name doesn't match its
    name in Add/Remove Programs?

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jim at Feb 8, 2013 at 9:51 am
    Hello Josh

    Thanks for reply so quickly, here is my manifest, thinking about it, I
    assume it because i'm installing the agent every time, do I need to do
    something like if service doesn't exist install else ignore ?

    regards

    James

    file { 'C:/Installs/check-mk-agent-1.2.1i5.exe':
    source => 'puppet:///modules/base/check-mk-agent-1.2.1i5.exe',
    mode => '0770',
    owner => 'SYSTEM',
    group => 'Administrators',
    } ->

    exec { 'Check_MK_Agent':
    command => 'C:/Installs/check-mk-agent-1.2.1i5.exe /S',
    } ~>

    service { 'Check_MK_Agent':
    ensure => 'running',
    enable => true,
    require => exec['Check_MK_Agent'],
    }

    On Thursday, 7 February 2013 16:24:10 UTC, Josh Cooper wrote:

    Hi Jim,

    On Thu, Feb 7, 2013 at 7:15 AM, jim <str...@gmail.com <javascript:>>
    wrote:
    Hello all,

    Can anyone please help, every time I push a config to my hosts, the windows
    service I have just defined keeps stopping and starting, and logging in the
    eventlog,

    I only want the service to stop and start, if something has changed, and to
    my knowledge nothing has changed ? so it should stay running ?

    Can some one please help or explain

    regards

    James

    --
    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 <javascript:>.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
    From http://docs.puppetlabs.com/references/latest/type.html#service,
    "Note that if a service receives an event from another resource, the
    service will get restarted."

    Can you post your manifest? Sounds like your service is subscribed to
    some other resource, perhaps a package whose name doesn't match its
    name in Add/Remove Programs?

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs
    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Feb 8, 2013 at 6:56 pm

    On Friday, February 8, 2013 3:20:33 AM UTC-6, jim wrote:
    Hello Josh

    Thanks for reply so quickly, here is my manifest, thinking about it, I
    assume it because i'm installing the agent every time, do I need to do
    something like if service doesn't exist install else ignore ?

    regards

    James

    file { 'C:/Installs/check-mk-agent-1.2.1i5.exe':
    source =>
    'puppet:///modules/base/check-mk-agent-1.2.1i5.exe',
    mode => '0770',
    owner => 'SYSTEM',
    group => 'Administrators',
    } ->

    exec { 'Check_MK_Agent':
    command => 'C:/Installs/check-mk-agent-1.2.1i5.exe /S',
    } ~>

    service { 'Check_MK_Agent':
    ensure => 'running',
    enable => true,
    require => exec['Check_MK_Agent'],
    }
    It is because the Exec runs every time and has a signaling relationship
    (designated by ~>) with the service. (And note that the Service's
    'require' of the Exec is redundant.) An Exec changes state from "not run"
    to "run" when its command is successfully executed, and that triggers an
    event to be dispatched to any listeners. Services restart if they receive
    events, which Puppet by default implements by stopping and then starting
    the service.

    The best approach would probably be to package the install program and
    anything else associated with the service into an installable package (i.e.
    an .msi file) and have the Service depend on the package instead of
    directly on the installer program. If that's not feasible, then you can
    use one or more of the Exec's 'onlyif', 'unless', and 'creates' parameters
    to instruct it whether it should execute the main command on any given
    catalog run.


    John

    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Josh Cooper at Feb 9, 2013 at 2:53 am

    On Fri, Feb 8, 2013 at 9:08 AM, jcbollinger wrote:
    On Friday, February 8, 2013 3:20:33 AM UTC-6, jim wrote:

    Hello Josh

    Thanks for reply so quickly, here is my manifest, thinking about it, I
    assume it because i'm installing the agent every time, do I need to do
    something like if service doesn't exist install else ignore ?

    regards

    James

    file { 'C:/Installs/check-mk-agent-1.2.1i5.exe':
    source =>
    'puppet:///modules/base/check-mk-agent-1.2.1i5.exe',
    mode => '0770',
    owner => 'SYSTEM',
    group => 'Administrators',
    } ->

    exec { 'Check_MK_Agent':
    command => 'C:/Installs/check-mk-agent-1.2.1i5.exe /S',
    } ~>

    service { 'Check_MK_Agent':
    ensure => 'running',
    enable => true,
    require => exec['Check_MK_Agent'],
    }
    It is because the Exec runs every time and has a signaling relationship
    (designated by ~>) with the service. (And note that the Service's
    'require' of the Exec is redundant.) An Exec changes state from "not run"
    to "run" when its command is successfully executed, and that triggers an
    event to be dispatched to any listeners. Services restart if they receive
    events, which Puppet by default implements by stopping and then starting the
    service.

    The best approach would probably be to package the install program and
    anything else associated with the service into an installable package (i.e.
    an .msi file) and have the Service depend on the package instead of directly
    on the installer program. If that's not feasible, then you can use one or
    more of the Exec's 'onlyif', 'unless', and 'creates' parameters to instruct
    it whether it should execute the main command on any given catalog run.
    Also, if you are using Puppet 3, then you can use the `package`
    resource to install the executable. Just make sure the package name in
    the manifest matches what's in Add/Remove Programs.

    Josh

    --
    Josh Cooper
    Developer, Puppet Labs

    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedFeb 7, '13 at 3:15p
activeFeb 9, '13 at 2:53a
posts5
users3
websitepuppetlabs.com

3 users in discussion

Josh Cooper: 2 posts Jim: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase