Issue #9798 has been updated by Deven Phillips.
Status changed from Closed to Re-opened
% Done changed from 100 to 80
I have this same issue and setting a custom status command is not working for
me...
<pre>
service { "snmpd":
ensure => running,
hasstatus => false,
status => "/bin/ps ax | grep -v grep | grep snmpd",
require => File['/etc/sysconfig/snmpd.options'],
}
</pre>
Which results in:
<pre>
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd status'
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd start'
notice: /Stage[main]/Snmpconfig/Service[snmpd]/ensure: ensure changed 'stopped'
to 'running'
debug: /Stage[main]/Snmpconfig/Service[snmpd]: The container Class[Snmpconfig]
will propagate my refresh event
debug: Class[Snmpconfig]: The container Stage[main] will propagate my refresh
event
</pre>
But the command specified returns the proper exit code:
<pre>
[06:25:59] root@fseddncacher1:~
# /bin/ps ax | grep -v grep | grep snmpd; echo $?
25825 ? S 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux
-p /var/run/snmpd.pid
0
</pre>
----------------------------------------
Bug #9798: Puppet saying "changed 'stopped' to 'running'" while the service
*is* running
https://projects.puppetlabs.com/issues/9798
Author: Jurgen Lamsens
Status: Re-opened
Priority: Normal
Assignee:
Category: provider
Target version:
Affected Puppet version: 2.6.8
Keywords:
Branch:
Let's say you have this manifest:
<pre>
root@tpc1-lucid:~# cat test.pp
class snmp {
package {"snmpd":
ensure => installed,
}
service {"snmpd":
enable => true,
ensure => running,
hasrestart => true,
hasstatus => true,
require => Package ["snmpd"],
}
}
node tpc1-lucid {
include snmp
}
</pre>
And you run it on a clean Ubuntu 10.04 LTS (Lucid), you will have:
<pre>
root@tpc1-lucid:~# puppet -d test.pp
...
notice: /Stage[main]/Snmp/Package[snmpd]/ensure: ensure changed 'purged' to
'present'
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd status'
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd start'
notice: /Stage[main]/Snmp/Service[snmpd]/ensure: ensure changed 'stopped' to
'running'
...
</pre>
So the service is started, right ?
<pre>
root@tpc1-lucid:~# ps faux | grep snmp[d]
snmp 2400 0.0 0.9 47560 4784 ? S 11:38 0:00
/usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p
/var/run/snmpd.pid 127.0.0.1
</pre>
Run puppet again:
<pre>
root@tpc1-lucid:~# puppet -d test.pp
...
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd status'
debug: Service[snmpd](provider=debian): Executing '/etc/init.d/snmpd start'
notice: /Stage[main]/Snmp/Service[snmpd]/ensure: ensure changed 'stopped' to
'running'
...
</pre>
Huh ? Changed stopped to running ? Apparently, the 'status' command for snmp
gives 2 lines of result:
<pre>
root@tpc1-lucid:~# /etc/init.d/snmpd status
* snmpd is running
* snmptrapd is not running
</pre>
When having only 1 line of result...
<pre>
root@tpc1-lucid:~# /etc/init.d/ssh status
* sshd is running
</pre>
... you don't have Puppet restarting the service.
Tx and regards,
Jurgen L.
--
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:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.