summaryrefslogtreecommitdiff
path: root/packages/initscripts/initscripts-1.0
diff options
context:
space:
mode:
Diffstat (limited to 'packages/initscripts/initscripts-1.0')
-rwxr-xr-xpackages/initscripts/initscripts-1.0/mountall.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-1.0/mountall.sh b/packages/initscripts/initscripts-1.0/mountall.sh
index b5cb85a1e9..65d5d26b24 100755
--- a/packages/initscripts/initscripts-1.0/mountall.sh
+++ b/packages/initscripts/initscripts-1.0/mountall.sh
@@ -41,5 +41,17 @@ then
swapon -a 2> /dev/null
fi
+# A missing homedirectory for root can cause all sorts of problems.
+# This can happen after user formats his /home partition for example
+
+if test -e /etc/passwd
+then
+ ROOT_HOME="`cat /etc/passwd|grep ^root | awk '{split($0,x,":");printf("%s\n",x[6])}'`"
+
+ if test -n "$ROOT_HOME"
+ then
+ ! test -d "$ROOT_HOME" && mkdir -p "$ROOT_HOME"
+ fi
+fi
: exit 0