Issue #14615 has been updated by Stefan Schulte.

Status changed from Closed to Re-opened
Target version deleted (2.7.15)

This issue is still present.

Puppet will query every suitable provider to get a list of services. While the 
`gentoo` and the `openrc` provider do not include the `shutdown.sh` script, the 
init provider still does. As a result puppet will also use the init provider to 
query the current state of the service and runs `/etc/init.d/shutdown.sh 
status` causing the system to shutdown immediatly.

Sample output (service `xdm-setup` is managed by the openrc provider, while 
`shutdown.sh` is managed by the init provider)
<pre>
% puppet -V
3.1.0
% puppet resource -vd service
[...]
Debug: Service xdm-setup found in both openrc and init; skipping the init 
version
Debug: /Service[reboot.sh]: Provider init does not support features enableable; 
not managing attribute enable
[...]
Debug: Executing '/sbin/rc-service xdm-setup status'
Debug: Executing '/bin/rc-status -C -a'
Debug: Executing '/etc/init.d/shutdown.sh status'
Debug: Executing '/etc/init.d/reboot.sh status'
[...]
</pre>
----------------------------------------
Bug #14615: puppet resource service will kill your gentoo system
https://projects.puppetlabs.com/issues/14615#change-83063

Author: Stefan Schulte
Status: Re-opened
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to