Bug 840834

Summary: Endless loop with /.autorelabel
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: systemdAssignee: systemd-maint
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, iarlyy, johannbg, jonathan, lnykryn, metherid, msekleta, notting, plautrba, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-14 19:41:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Safranek 2012-07-17 10:57:58 UTC
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 10:02:28 UTC
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 11:56:07 UTC
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 20:45:04 UTC
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 19:41:11 UTC
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.