Skip to content

"Relabel" / restorecon is run by systemd and blocks the boot process for several hours #73

@digulla

Description

@digulla

I've updated from Leap 15.6 to 16.0.
Note: This might be wrong project to report this bug; please let me know where I can file it instead if this is the case.

During my first boot, I was very surprised when the boot process hung with an unexpected start job Relabel /home.

There were the following problems with this:

  1. My system was inaccessible for FOUR HOURS while this task was running (2TB /home with about 100GB free space).
  2. There was no information in the migration documentation or anywhere on https://doc.opensuse.org/documentation/leap/ what this job does.
  3. I didn't know whether or how I could abort it safely without destroying my system.
  4. There was no time limit for the job or any indication how long it might take.
  5. The job eventually ran out of disk space leaving me with two choices: Restore 15.6 from my backup or to find out what this strange job was trying to do, somehow gain access to my system when systemd wants to run this job before granting me a root shell, spend an unknown amount of time to fix the underlying problem, ... This was a very unpleasant experience.

Suggested fix:

  1. Add information about the need for relabeling and restorecon to https://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/16.0/html/release-notes-leap-160/, https://en.opensuse.org/Portal:SELinux/Common_issues and https://github.com/openSUSE/opensuse-migration-tool.
  2. Run restorecon during the migration before rebooting. For big filesystems, add an indication how long this will take. Make sure you gracefully handle the case when you run out of disk space (like asking the user to make room and retry).

If you absolutely have to run relabel during boot:

  • limit it to the system folders (/bin, /lib, /usr, /var, etc)
  • make sure the system can boot by disabling SELinux or at least running it in permissive mode.
  • make sure the migration documentation mentions the job and what it entails and how to guess how long it might run and how much free disk space it needs.
  • if possible (I don't know enough about systemd), make the start job fail after a minute or continue in the background

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions