Bug 840834 - Endless loop with /.autorelabel
Endless loop with /.autorelabel
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-17 06:57 EDT by Jan Safranek
Modified: 2013-01-14 14:41 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-14 14:41:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Safranek 2012-07-17 06:57:58 EDT
Description of problem:
when /.autorelabel is present on my disk, the disks is relabelled during boot and rebooted, but something does not remove the .autorelabel file and the disk is relabelled and rebooted again and again.

Version-Release number of selected component (if applicable):
systemd-186-2.fc18.x86_64
selinux-policy-targeted-3.11.0-10.fc18.noarch
libselinux-utils-2.1.11-2.fc18.x86_64
policycoreutils-2.1.12-3.fc18.x86_64
initscripts-9.39-2.fc18.x86_64

How reproducible:
always

Steps to Reproduce:
1. touch /.autorelabel
2. reboot <in enforcing mode>
  
Actual results:
1. filesystem is relabelled
2. system reboots
3. go to 1

Expected results:
1. filesystem is relabelled
2. system reboots 
3. system boots normally

I don't know if it's systemd or selinux fault, please reassign as appropriate.
Comment 1 Daniel Walsh 2012-07-24 06:02:28 EDT
Jan is this problem continuing, I have not been able to reproduce it.  If you look at the scripts it there something that is blowing up before it gets to the point of removing the autorelabel?
Comment 2 Jan Safranek 2012-07-25 07:56:07 EDT
It's quite tricky to debug these parts...

If I modify /lib/systemd/fedora-autorelabel this way, the system works well, i.e. only one relabel:

    rm -f  /.autorelabel
+   ( date; ls -la / ) >>/var/log/jsaf
+   sync
    systemctl --force reboot

Without 'sync', the system enters endless loop of relabelling and I don't see anything in /var/log/jsaf. It seems 'systemctl --force reboot' is not that safe as it claims.

I can reproduce it on my virtual machine, rolling rawhide since F14 or so. I had to fix it manually many times, as rawhide breaks up quite often to me.
Comment 3 Bill Nottingham 2012-08-02 16:45:04 EDT
The man page for systemctl claims that "--force reboot" does a umount/remount readonly. This *should* sync the filesystem as well; if it's not, something is going wrong there.
Comment 4 Lennart Poettering 2013-01-14 14:41:11 EST
I presume this was caused by the issue fixed with "0049f05a8bb82c3e084bacc5945596761d706c55". This has been fixed a while ago in F18. Closing. 

Please reopen if the issue continues to exist.

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