diff options
author | Bill Nottingham <notting@redhat.com> | 2005-09-21 19:26:20 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2005-09-21 19:26:20 +0000 |
commit | d93f2746707ba6817b9079e5f8af829507545363 (patch) | |
tree | bac13ed95850e11fedf2290f1fe591d3c492f50e /rc.d/rc.sysinit | |
parent | 3697a6f3365fb3be4e5528495517018f11664ec3 (diff) | |
download | initscripts-d93f2746707ba6817b9079e5f8af829507545363.tar initscripts-d93f2746707ba6817b9079e5f8af829507545363.tar.gz initscripts-d93f2746707ba6817b9079e5f8af829507545363.tar.bz2 initscripts-d93f2746707ba6817b9079e5f8af829507545363.tar.xz initscripts-d93f2746707ba6817b9079e5f8af829507545363.zip |
automatically reboot if labels are really out of date (<dwalsh@redhat.com>)
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-x | rc.d/rc.sysinit | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 5eb5ac77..31c694d1 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -54,6 +54,9 @@ relabel_selinux() { if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then chvt 1 fi + # if /sbin/init is not labeled correctly this process is running in the + # wrong context, so a reboot will be reuired after relabel + REBOOTFLAG=`restorecon -v /sbin/init` . /etc/selinux/config echo " *** Warning -- SELinux ${SELINUXTYPE} policy relabel is required. *** @@ -63,6 +66,10 @@ relabel_selinux() { echo "0" > $selinuxfs/enforce /sbin/fixfiles restore > /dev/null 2>&1 rm -f /.autorelabel + if [ ! -z "$REBOOTFLAG" ]; then + echo $"Automatic reboot in progress." + reboot -f + fi echo $SELINUX > $selinuxfs/enforce if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then chvt 8 |