Changeset 99508 in vbox for trunk/src/VBox/Additions/linux/installer/vboxadd.sh
- Timestamp:
- Apr 21, 2023 3:47:20 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r99505 r99508 149 149 BUILDINTMP="$MODULE_SRC/build_in_tmp" 150 150 151 # Path to VBoxService control script. 152 VBOX_SERVICE_SCRIPT="/usr/sbin/rcvboxadd-service" 153 151 154 # Attempt to detect VirtualBox Guest Additions version and revision information. 152 155 VBOXCONTROL="${INSTALL_DIR}/bin/VBoxControl" … … 230 233 231 234 [ "$expected" = "$(running_module_version "$mod")" ] || return 232 }233 234 235 # Checks if systemctl is present and functional (i.e., systemd is the init process).236 use_systemd()237 {238 systemctl status >/dev/null 2>&1239 }240 241 # Returns if we did install a service as a systemd service.242 #243 # Input $1: Service name to check.244 #245 # Returns true if the service is installed as a systemd service, false if not.246 systemd_service_installed()247 {248 ## Name of service to test.249 name="${1}"250 251 test -f /lib/systemd/system/"${name}".service ||252 test -f /usr/lib/systemd/system/"${name}".service253 }254 255 ## Performs an action on a service256 do_sysvinit_action()257 {258 ## Name of service to start.259 name="${1}"260 ## The action to perform, normally "start", "stop" or "status".261 action="${2}"262 263 if use_systemd -a systemd_service_installed "${name}"; then264 systemctl -q ${action} "${name}"265 elif test -x "/etc/rc.d/init.d/${name}"; then266 "/etc/rc.d/init.d/${name}" "${action}" quiet267 elif test -x "/etc/init.d/${name}"; then268 "/etc/init.d/${name}" "${action}" quiet269 fi270 235 } 271 236 … … 1088 1053 1089 1054 # Stop VBoxService if running. 1090 do_sysvinit_action vboxadd-servicestatus >/dev/null 2>&11055 $VBOX_SERVICE_SCRIPT status >/dev/null 2>&1 1091 1056 if [ $? -eq 0 ]; then 1092 do_sysvinit_action vboxadd-servicestop >/dev/null 2>&1 || fail "unable to stop VBoxService"1057 $VBOX_SERVICE_SCRIPT stop >/dev/null 2>&1 || fail "unable to stop VBoxService" 1093 1058 fi 1094 1059 … … 1141 1106 1142 1107 # Start VBoxService and VBoxDRMClient (systemctl start vboxadd-service.service). 1143 [ $? -eq 0 ] && do_sysvinit_action vboxadd-servicestart >/dev/null 2>&11108 [ $? -eq 0 ] && $VBOX_SERVICE_SCRIPT start >/dev/null 2>&1 1144 1109 1145 1110 # Reload VBoxClient processes.
Note:
See TracChangeset
for help on using the changeset viewer.