Commit 381f66b2d3afe91970c403f1e0ef2ad09fc849f7

Authored by Silvan Calarco
1 parent fc44a0346b
Exists in master

rc: fix shutdown in not-multithreaded sysv5 mode

Showing 1 changed file with 13 additions and 14 deletions Side-by-side Diff

... ... @@ -55,13 +55,6 @@
55 55  
56 56 export RUNLEVEL
57 57  
58   -[ -e /run/plymouth/pid ] || {
59   -# workaround for plymouthd stopping at runlevel change with non-KMS drivers
60   - $PLYMOUTHD --attach-to-session --pid-file /run/plymouth/pid
61   - $PLYMOUTH --show-splash
62   - WORKAROUND=1
63   -}
64   -
65 58 [ "$previous" != "N" ] && progressbase=10 || progressbase=65
66 59  
67 60 if [ "$runlevel" = "0" -o "$runlevel" = "6" ]; then
68 61  
... ... @@ -73,9 +66,21 @@
73 66 $PLYMOUTH message --text=$"System rebooting, please wait..."
74 67 fi
75 68 else
  69 + [ -e /run/plymouth/pid ] || {
  70 + # workaround for plymouthd stopping at runlevel change with non-KMS drivers
  71 + $PLYMOUTHD --attach-to-session --pid-file /run/plymouth/pid
  72 + $PLYMOUTH --show-splash
  73 + WORKAROUND=1
  74 + }
76 75 $PLYMOUTH message --text=$"Starting services..."
77 76 fi
78 77  
  78 +if [ "$runlevel" == "5" -a "$previous" == "N" ]; then
  79 + [ -e /run/plymouth/pid ] && touch /var/spool/gdm/force-display-on-active-vt
  80 +else
  81 + rm -f /var/spool/gdm/force-display-on-active-vt || true
  82 +fi
  83 +
79 84 allservicesnum=`ls -1 $rc_base/rc$runlevel.d/[S,K]* 2>/dev/null | wc -l`
80 85  
81 86 if [ "$previous" != "N" ]; then
... ... @@ -103,7 +108,7 @@
103 108 fi
104 109  
105 110 progress=`expr $progressbase + $i \* \( 100 - $progressbase \) / ${allservicesnum}`
106   - $servicefile stop >> $LOGFILE
  111 + [ -w $LOGFILE ] && $servicefile stop >> $LOGFILE || $servicefile stop
107 112 i=`expr $i + 1`
108 113 }
109 114 done
... ... @@ -112,12 +117,6 @@
112 117 fi
113 118  
114 119 echo -e $"Starting runlevel $runlevel services...""\r"
115   -
116   -if [ "$runlevel" == "5" -a "$previous" == "N" ]; then
117   - [ -e /run/plymouth/pid ] && touch /var/spool/gdm/force-display-on-active-vt
118   -else
119   - rm -f /var/spool/gdm/force-display-on-active-vt
120   -fi
121 120  
122 121 if [ "$multithread" = "1" ]; then
123 122