VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/debian/preinst

最後變更 在這個檔案是 107964,由 vboxsync 提交於 7 週 前

Installer: Linux: Ask VBoxSVC to terminate gacefully and wait for it if it is running during installation, bugref:10850.

This behavior was in place before, however we did not send SIGUSR1 to VBoxSVC
in case of .run installer (or did it in condition which was never true) and we
were waiting too litle to give it a chance to terminate.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.8 KB
 
1#!/bin/bash
2# $Id: preinst 107964 2025-01-28 14:18:42Z vboxsync $
3## @file
4# VirtualBox pre-install.
5#
6
7#
8# Copyright (C) 2006-2024 Oracle and/or its affiliates.
9#
10# This file is part of VirtualBox base platform packages, as
11# available from https://www.alldomusa.eu.org.
12#
13# This program is free software; you can redistribute it and/or
14# modify it under the terms of the GNU General Public License
15# as published by the Free Software Foundation, in version 3 of the
16# License.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, see <https://www.gnu.org/licenses>.
25#
26# SPDX-License-Identifier: GPL-3.0-only
27#
28
29# we can be called with the following arguments (6.5 of Debian policy):
30# install: (our version): install our version
31# upgrade: (our version): upgrade to our version
32# abort-upgrade: (old version): upgrade to a new version failed
33
34# defaults
35[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
36
37if [ "$1" = "install" -o "$1" = "upgrade" ]; then
38
39 . /usr/share/debconf/confmodule
40 db_version 2.0
41 db_capb backup
42
43 # check for old installation
44 if [ -r /etc/vbox/vbox.cfg ]; then
45 . /etc/vbox/vbox.cfg
46 if [ "x$INSTALL_DIR" != "x" -a -d "$INSTALL_DIR" ]; then
47 db_fset virtualbox/old-installation-found seen false || true
48 db_input critical virtualbox/old-installation-found || true
49 db_go || true
50 exit 1
51 fi
52 # we will remove that file in postinst
53 fi
54
55 # check for active VMs
56 # Execute the installed package's pre-uninstaller if present.
57 /usr/lib/virtualbox/prerm-common.sh 2>/dev/null || true
58 # Stop services from older versions without pre-uninstaller.
59 invoke-rc.d vboxballoonctrl-service stop 2>/dev/null || true
60 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null || true
61 invoke-rc.d vboxautostart-service stop 2>/dev/null || true
62 /etc/init.d/vboxautostart-service stop 2>/dev/null || true
63 invoke-rc.d vboxweb-service stop 2>/dev/null || true
64 /etc/init.d/vboxweb-service stop 2>/dev/null || true
65 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
66 if [ -n "$VBOXSVC_PID" ]; then
67 # Ask VBoxSVC to terminate gracefully if it is not
68 # busy with handling client requests.
69 kill -USR1 $VBOXSVC_PID
70 # Wait for VBoxSVC to terminate.
71 for attempt in 1 2 3 4 5 6 7 8 9 10; do
72 [ -n "$(pidof VBoxSVC 2> /dev/null)" ] && sleep 1
73 done
74 # Still running?
75 if pidof VBoxSVC > /dev/null 2>&1; then
76 db_fset virtualbox/old-running seen false || true
77 db_input critical virtualbox/old-running || true
78 db_go || true
79 exit 1
80 fi
81 fi
82
83fi # "$1" = "install" -o "$1" = "upgrade"
84
85#DEBHELPER#
86
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette