Issue #14615 has been updated by Daniel Pittman.
Status changed from In Topic Branch Pending Review to Tests Insufficient
I get a pile of failures testing this on the mac after merging it manually to
the 2.7RC branch:
<pre>
1) Puppet::Type::Service::ProviderGentoo.instances should get a list of
services from /etc/init.d but exclude helper scripts
Failure/Error: ]
expected: ["alsasound", "bootmisc", "hwclock", "rsyncd", "sshd",
"vixie-cron", "wpa_supplicant", "xdm-setup"]
got: [] (using ==)
# ./spec/unit/provider/service/gentoo_spec.rb:60
2) Puppet::Type::Service::ProviderGentoo#start should start the service with
<initscript> start otherwise
Failure/Error: provider.start
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:116:in `startcmd'
# ./lib/puppet/provider/service/base.rb:139:in `send'
# ./lib/puppet/provider/service/base.rb:139:in `ucommand'
# ./lib/puppet/provider/service/base.rb:82:in `start'
# ./spec/unit/provider/service/gentoo_spec.rb:73
3) Puppet::Type::Service::ProviderGentoo#stop should stop the service with
<initscript> stop otherwise
Failure/Error: provider.stop
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:121:in `stopcmd'
# ./lib/puppet/provider/service/base.rb:102:in `stop'
# ./spec/unit/provider/service/gentoo_spec.rb:86
4) Puppet::Type::Service::ProviderGentoo#status when hasstatus is true should
return running if <initscript> status exits with a zero exitcode
Failure/Error: provider.status.should == :running
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:132:in `statuscmd'
# ./lib/puppet/provider/service/base.rb:58:in `status'
# ./spec/unit/provider/service/gentoo_spec.rb:189
5) Puppet::Type::Service::ProviderGentoo#status when hasstatus is true should
return stopped if <initscript> status exits with a non-zero exitcode
Failure/Error: provider.status.should == :stopped
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:132:in `statuscmd'
# ./lib/puppet/provider/service/base.rb:58:in `status'
# ./spec/unit/provider/service/gentoo_spec.rb:196
6) Puppet::Type::Service::ProviderGentoo#restart should restart the service
with <initscript> restart if hasrestart is true
Failure/Error: provider.restart
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:125:in `restartcmd'
# ./lib/puppet/provider/service/base.rb:40:in `restart'
# ./spec/unit/provider/service/gentoo_spec.rb:212
7) Puppet::Type::Service::ProviderGentoo#restart should restart the service
with <initscript> stop/start if hasrestart is false
Failure/Error: provider.restart
Puppet::Error:
Could not find init script for 'sshd'
# ./lib/puppet/provider/service/init.rb:111:in `search'
# ./lib/puppet/provider/service/init.rb:65:in `initscript'
# ./lib/puppet/provider/service/init.rb:121:in `stopcmd'
# ./lib/puppet/provider/service/base.rb:102:in `stop'
# ./lib/puppet/provider/service/base.rb:43:in `restart'
# ./spec/unit/provider/service/gentoo_spec.rb:220
Finished in 2 minutes 23.52 seconds
15152 examples, 7 failures, 109 pending
Failed examples:
rspec ./spec/unit/provider/service/gentoo_spec.rb:43 #
Puppet::Type::Service::ProviderGentoo.instances should get a list of services
from /etc/init.d but exclude helper scripts
rspec ./spec/unit/provider/service/gentoo_spec.rb:70 #
Puppet::Type::Service::ProviderGentoo#start should start the service with
<initscript> start otherwise
rspec ./spec/unit/provider/service/gentoo_spec.rb:83 #
Puppet::Type::Service::ProviderGentoo#stop should stop the service with
<initscript> stop otherwise
rspec ./spec/unit/provider/service/gentoo_spec.rb:185 #
Puppet::Type::Service::ProviderGentoo#status when hasstatus is true should
return running if <initscript> status exits with a zero exitcode
rspec ./spec/unit/provider/service/gentoo_spec.rb:192 #
Puppet::Type::Service::ProviderGentoo#status when hasstatus is true should
return stopped if <initscript> status exits with a non-zero exitcode
rspec ./spec/unit/provider/service/gentoo_spec.rb:209 #
Puppet::Type::Service::ProviderGentoo#restart should restart the service with
<initscript> restart if hasrestart is true
rspec ./spec/unit/provider/service/gentoo_spec.rb:215 #
Puppet::Type::Service::ProviderGentoo#restart should restart the service with
<initscript> stop/start if hasrestart is false
124.05s user 15.54s system 91% cpu 2:32.39 total
</pre>
It all looks good, so I guess this is just a test stubbing headache.
----------------------------------------
Bug #14615: puppet resource service will kill your gentoo system
https://projects.puppetlabs.com/issues/14615#change-64046
Author: Stefan Schulte
Status: Tests Insufficient
Priority: Normal
Assignee: Stefan Schulte
Category: service
Target version:
Affected Puppet version:
Keywords: gentoo, service
Branch: https://github.com/puppetlabs/puppet/pull/808
If executing `puppet resource service` on gentoo, puppet will get a list of
services from `/etc/init.d` and will issue `<initscript> status` on all of
them. This will immediatly reboot your system and you will be greeted with a
filesystem check afterwards. I consider this "not expected behaviour" ;-)
This happens as soon as puppet reaches the following standard gentoo script
<pre>
# equery belongs /etc/init.d/reboot.sh
* Searching for /etc/init.d/reboot.sh ...
sys-apps/sysvinit-2.88-r3 (/etc/init.d/reboot.sh)
</pre>
which does not implement any switches
<pre>
# cat /etc/init.d/reboot.sh
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
opts="-dpk"
[ "${RC_DOWN_INTERFACE}" = "yes" ] && opts="${opts}i"
/sbin/reboot "${opts}" 2>/dev/null
# hmm, if the above failed, that's kind of odd ...
# so let's force a reboot
/sbin/reboot -f
</pre>
the gentoo service provider should have an exclude list of services like the
redhat provider does.
--
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.