diff --git a/etc/rc.d/init.d/rc b/etc/rc.d/init.d/rc index eadccd2..ed74622 100755 --- a/etc/rc.d/init.d/rc +++ b/etc/rc.d/init.d/rc @@ -55,13 +55,6 @@ rex="[0-9][0-9]" export RUNLEVEL -[ -e /run/plymouth/pid ] || { -# workaround for plymouthd stopping at runlevel change with non-KMS drivers - $PLYMOUTHD --attach-to-session --pid-file /run/plymouth/pid - $PLYMOUTH --show-splash - WORKAROUND=1 -} - [ "$previous" != "N" ] && progressbase=10 || progressbase=65 if [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then @@ -73,9 +66,21 @@ if [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then $PLYMOUTH message --text=$"System rebooting, please wait..." fi else + [ -e /run/plymouth/pid ] || { + # workaround for plymouthd stopping at runlevel change with non-KMS drivers + $PLYMOUTHD --attach-to-session --pid-file /run/plymouth/pid + $PLYMOUTH --show-splash + WORKAROUND=1 + } $PLYMOUTH message --text=$"Starting services..." fi +if [ "$runlevel" == "5" -a "$previous" == "N" ]; then + [ -e /run/plymouth/pid ] && touch /var/spool/gdm/force-display-on-active-vt +else + rm -f /var/spool/gdm/force-display-on-active-vt || true +fi + allservicesnum=`ls -1 $rc_base/rc$runlevel.d/[S,K]* 2>/dev/null | wc -l` if [ "$previous" != "N" ]; then @@ -103,7 +108,7 @@ if [ "$previous" != "N" ]; then fi progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}` - $servicefile stop >> $LOGFILE + [ -w $LOGFILE ] && $servicefile stop >> $LOGFILE || $servicefile stop i=`expr $i + 1` } done @@ -113,12 +118,6 @@ fi echo -e $"Starting runlevel $runlevel services...""\r" -if [ "$runlevel" == "5" -a "$previous" == "N" ]; then - [ -e /run/plymouth/pid ] && touch /var/spool/gdm/force-display-on-active-vt -else - rm -f /var/spool/gdm/force-display-on-active-vt -fi - if [ "$multithread" = "1" ]; then # recreate multithreaded dependencies