rc.sysinit: fix log writing to file in non debug mode to prevent writing to read-only filesystem
This commit is contained in:
parent
fe6ca9f9f9
commit
9dd92f64e8
@ -42,18 +42,15 @@ for cmd in $CMDLINE; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[ $debug -gt 0 ] && logfile="/dev/console"
|
[ $debug -gt 0 ] && logfile="/dev/console" || logfile="/dev/null"
|
||||||
|
|
||||||
[ $logfile ] || {
|
|
||||||
logfile="/dev/.sysinit.start"
|
|
||||||
> $logfile
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! -d $rc_base/rc$runlevel.d ]; then
|
if [ ! -d $rc_base/rc$runlevel.d ]; then
|
||||||
echo $"$rc_base/rc$runlevel.d does not exist"
|
echo $"$rc_base/rc$runlevel.d does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# set dns-resolving safe hostname for sysinit to successfully run
|
# set dns-resolving safe hostname for sysinit to successfully run
|
||||||
hostname localhost
|
hostname localhost
|
||||||
|
|
||||||
@ -62,6 +59,11 @@ startservicesnum=`echo $startservices | wc -w`
|
|||||||
|
|
||||||
i=0
|
i=0
|
||||||
for servicefile in $startservices; do
|
for servicefile in $startservices; do
|
||||||
|
# write log to file as soon as writable filesystem is available
|
||||||
|
[ $logfile = "/dev/null" -a -w "/run" ] && {
|
||||||
|
logfile="/run/.sysinit.start"
|
||||||
|
> $logfile
|
||||||
|
}
|
||||||
if [ "$previous" != "N" ]; then
|
if [ "$previous" != "N" ]; then
|
||||||
service=${servicefile#$rc_base/rc$runlevel.d/S$rex}
|
service=${servicefile#$rc_base/rc$runlevel.d/S$rex}
|
||||||
stop=$rc_base/rc$runlevel.d/K$rex$service
|
stop=$rc_base/rc$runlevel.d/K$rex$service
|
||||||
@ -74,7 +76,6 @@ for servicefile in $startservices; do
|
|||||||
progress=`expr 5 + $i \* 45 / $startservicesnum`
|
progress=`expr 5 + $i \* 45 / $startservicesnum`
|
||||||
|
|
||||||
$PLYMOUTH update --status="$progress"
|
$PLYMOUTH update --status="$progress"
|
||||||
|
|
||||||
if [ "$service" = "postplug" ]; then
|
if [ "$service" = "postplug" ]; then
|
||||||
$servicefile start
|
$servicefile start
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user