Bug 967002 - cloud-init should gracefully degrade when booted with selinux=0
Summary: cloud-init should gracefully degrade when booted with selinux=0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cloud-init
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Garrett Holmstrom
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-24 13:37 UTC by Matthew Miller
Modified: 2013-10-18 19:54 UTC (History)
6 users (show)

Fixed In Version: cloud-init-0.7.2-7.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-18 19:54:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matthew Miller 2013-05-24 13:37:49 UTC
I know, Dan Walsh will weep (http://stopdisablingselinux.com/) but sometimes it's helpful for testing. Cloud-init currently completely bails in this situation; I think it should do what it can and move on.

Comment 1 Robert Brown 2013-07-08 00:03:10 UTC
+1, or at least make the log messages clearer. Here's what you see in /var/log/cloud-init.log when you boot with SELinux disabled.

Jul  7 16:44:12 localhost [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /var/lib/cloud (recursive=False)
Jul  7 16:44:12 localhost [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /var/lib/cloud/scripts (recursive=False)
Jul  7 16:44:12 localhost [CLOUDINIT] util.py[WARNING]: Failed to initialize, likely bad things to come!
Jul  7 16:44:12 localhost [CLOUDINIT] util.py[DEBUG]: Failed to initialize, likely bad things to come!


That's it. Googling does not easily turn up log messages that indicate this is a problem. Switching selinux to permissive fixes the problem and allows cloud-init to proceed without error.

Comment 2 Mark McLoughlin 2013-09-17 17:53:23 UTC
With cloud-init-0.7.2-1.fc19.noarch I'm seeing

  $> /usr/bin/cloud-init init
  ...
  Traceback (most recent call last):
  File "/usr/bin/cloud-init", line 509, in <module>
    sys.exit(main())
  File "/usr/bin/cloud-init", line 505, in main
    return functor(name, args)
  File "/usr/bin/cloud-init", line 256, in main_init
    iid = init.instancify()
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 311, in instancify
    return self._reflect_cur_instance()
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 268, in _reflect_cur_instance
    util.ensure_dirs(dir_list)
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1229, in ensure_dirs
    ensure_dir(d, mode)
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1269, in ensure_dir
    chmod(path, mode)
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1416, in chmod
    os.chmod(path, real_mode)
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 184, in __exit__
    self.selinux.restorecon(path, recursive=self.recursive)
  File "/usr/lib/python2.7/site-packages/selinux/__init__.py", line 84, in restorecon
    status, oldcontext = lgetfilecon(path)
  OSError: [Errno 61] No data available

Comment 3 Fedora Update System 2013-09-25 02:41:43 UTC
cloud-init-0.7.2-6.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/cloud-init-0.7.2-6.fc20

Comment 4 Fedora Update System 2013-09-25 02:43:03 UTC
cloud-init-0.7.2-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/cloud-init-0.7.2-6.fc19

Comment 5 Fedora Update System 2013-09-27 00:44:32 UTC
Package cloud-init-0.7.2-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cloud-init-0.7.2-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17724/cloud-init-0.7.2-7.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-09-27 01:20:00 UTC
cloud-init-0.7.2-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/cloud-init-0.7.2-7.fc18

Comment 7 Fedora Update System 2013-10-15 06:28:46 UTC
cloud-init-0.7.2-7.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-10-18 19:46:20 UTC
cloud-init-0.7.2-7.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2013-10-18 19:54:36 UTC
cloud-init-0.7.2-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.