Index: trunk/src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- trunk/src/VBox/Additions/linux/installer/vboxadd.sh	(revision 99512)
+++ trunk/src/VBox/Additions/linux/installer/vboxadd.sh	(revision 99524)
@@ -67,4 +67,5 @@
 OLDMODULES="vboxguest vboxadd vboxsf vboxvfs vboxvideo"
 SERVICE="VirtualBox Guest Additions"
+VBOXSERVICE_PIDFILE="/var/run/vboxadd-service.sh"
 ## systemd logs information about service status, otherwise do that ourselves.
 QUIET=
@@ -120,5 +121,5 @@
 {
     log "${1}"
-    echo "$1" >&2
+    echo "${SERVICE}: $1" >&2
     echo "The log file $LOG may contain further information." >&2
     exit 1
@@ -962,5 +963,5 @@
 check_pid()
 {
-    pid=$1
+    pid="$1"
 
     test -n "$pid" -a -d "/proc/$pid"
@@ -1008,15 +1009,16 @@
 check_status_user()
 {
-    check_pid "$(cat /var/run/vboxadd-service.sh)" >/dev/null 2>&1
-}
-
-send_sig_usr1_by_pidfile()
-{
-    pidfile=$1
+    [ -r "$VBOXSERVICE_PIDFILE" ] && check_pid "$(cat $VBOXSERVICE_PIDFILE)" >/dev/null 2>&1
+}
+
+send_signal_by_pidfile()
+{
+    sig="$1"
+    pidfile="$2"
 
     if [ -f "$pidfile" ]; then
         check_pid $(cat "$pidfile")
         if [ $? -eq 0 ]; then
-            kill -USR1 $(cat "$pidfile") >/dev/null 2>&1
+            kill "$sig" $(cat "$pidfile") >/dev/null 2>&1
         else
             # Do not spoil $?.
@@ -1032,9 +1034,10 @@
 # update is started or kernel modules are going to be reloaded,
 # so VBoxClient can release vboxguest.ko resources and then restart itself.
-send_sig_usr1()
-{
+send_signal()
+{
+    sig="$1"
     # Specify whether we sending signal to VBoxClient parent (control)
     # process or a child (actual service) process.
-    process_type="$1"
+    process_type="$2"
 
     pidfile_postfix=""
@@ -1053,9 +1056,24 @@
                 [ -z "$process_type" -a -n "$(echo "$pid_file" | grep "service")" ] && continue
 
-                send_sig_usr1_by_pidfile "$pid_file"
+                send_signal_by_pidfile -USR1 "$pid_file"
             done
 
         fi
     done
+}
+
+# Helper function which executes a command, prints error message if command fails,
+# and preserves command execution status for further processing.
+try_load_preserve_rc()
+{
+    cmd="$1"
+    msg="$2"
+
+    $cmd >/dev/null 2>&1
+
+    rc=$?
+    [ $rc -eq 0 ] || info "$msg"
+
+    return $rc
 }
 
@@ -1071,15 +1089,15 @@
 
     # Unmount Shared Folders.
-    umount -a -t vboxsf >/dev/null 2>&1 || fail "unable to unmount shared folders"
+    umount -a -t vboxsf >/dev/null 2>&1 || fail "unable to unmount shared folders, mount point(s) might be still in use"
 
     # Stop VBoxDRMClient.
-    send_sig_usr1_by_pidfile "/var/run/VBoxDRMClient" || fail "unable to stop VBoxDRMClient"
+    send_signal_by_pidfile "-USR1" "/var/run/VBoxDRMClient" || fail "unable to stop VBoxDRMClient"
 
     if [ $? -eq 0 ]; then
         # Tell legacy VBoxClient processes to release vboxguest.ko references.
-        send_sig_usr1 ""
+        send_signal "-USR1" ""
 
         # Tell compatible VBoxClient processes to release vboxguest.ko references.
-        send_sig_usr1 "service"
+        send_signal "-USR1" "service"
 
         # Try unload.
@@ -1107,5 +1125,6 @@
         running_vboxguest
         if [ $? -eq 0 ]; then
-            fail "Cannot reload kernel modules: one or more module(s) is still in use"
+            info "cannot reload kernel modules: one or more module(s) is still in use"
+            false
         else
             # Do not spoil $?.
@@ -1114,12 +1133,12 @@
 
         # Load drivers (skip vboxvideo since it is not loaded for very old guests).
-        [ $? -eq 0 ] && modprobe vboxguest >/dev/null 2>&1
-        [ $? -eq 0 ] && modprobe vboxsf >/dev/null 2>&1
+        [ $? -eq 0 ] && try_load_preserve_rc "modprobe vboxguest" "unable to load vboxguest kernel module, see dmesg"
+        [ $? -eq 0 ] && try_load_preserve_rc "modprobe vboxsf" "unable to load vboxsf kernel module, see dmesg"
 
         # Start VBoxService and VBoxDRMClient.
-        [ $? -eq 0 ] && $VBOX_SERVICE_SCRIPT start >/dev/null 2>&1
+        [ $? -eq 0 ] && try_load_preserve_rc "$VBOX_SERVICE_SCRIPT start" "unable to start VBoxService"
 
         # Reload VBoxClient processes.
-        [ $? -eq 0 ] && send_sig_usr1 "control"
+        [ $? -eq 0 ] && try_load_preserve_rc "send_signal "-USR1" control" "unable to reload user session services"
 
         if [ $? -eq 0 ]; then
@@ -1135,5 +1154,8 @@
             info "NOTE: you may still consider to re-login if some user session specific services (Shared Clipboard, Drag and Drop, Seamless or Guest Screen Resize) were not restarted automatically"
         else
-            fail "cannot verify if kernel modules and services were reloaded"
+            # In case of failure, sent SIGTERM to abandoned control processes to remove leftovers from failed reloading.
+            send_signal "-TERM" "control"
+
+            fail "kernel modules and services were not reloaded"
         fi
     else
@@ -1218,5 +1240,6 @@
         info "User-land services are running"
     else
-        fail "User-land services are not running"
+        info "User-land services are not running"
+        false
     fi
     ;;
