VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/prerm-common.sh@ 99844

Last change on this file since 99844 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1#!/bin/sh
2# $Id: prerm-common.sh 98103 2023-01-17 14:15:46Z vboxsync $
3## @file
4# Oracle VM VirtualBox
5# VirtualBox Linux pre-uninstaller common portions
6#
7
8#
9# Copyright (C) 2015-2023 Oracle and/or its affiliates.
10#
11# This file is part of VirtualBox base platform packages, as
12# available from https://www.virtualbox.org.
13#
14# This program is free software; you can redistribute it and/or
15# modify it under the terms of the GNU General Public License
16# as published by the Free Software Foundation, in version 3 of the
17# License.
18#
19# This program is distributed in the hope that it will be useful, but
20# WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22# General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with this program; if not, see <https://www.gnu.org/licenses>.
26#
27# SPDX-License-Identifier: GPL-3.0-only
28#
29
30# Put bits of the pre-uninstallation here which should work the same for all of
31# the Linux installers. We do not use special helpers (e.g. dh_* on Debian),
32# but that should not matter, as we know what those helpers actually do, and we
33# have to work on those systems anyway when installed using the all
34# distributions installer.
35#
36# We assume that all required files are in the same folder as this script
37# (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
38#
39# Script exit status: 0 on success, 1 if VirtualBox is running and can not be
40# stopped (installers may show an error themselves or just pass on standard
41# error).
42
43
44# The below is GNU-specific. See VBox.sh for the longer Solaris/OS X version.
45TARGET=`readlink -e -- "${0}"` || exit 1
46MY_PATH="${TARGET%/[!/]*}"
47cd "${MY_PATH}"
48. "./routines.sh"
49
50# Stop the ballon control service
51stop_init_script vboxballoonctrl-service >/dev/null 2>&1
52# Stop the autostart service
53stop_init_script vboxautostart-service >/dev/null 2>&1
54# Stop the web service
55stop_init_script vboxweb-service >/dev/null 2>&1
56# Do this check here after we terminated the web service: check whether VBoxSVC
57# is running and exit if it can't be stopped.
58check_running
59# Terminate VBoxNetDHCP if running
60terminate_proc VBoxNetDHCP
61# Terminate VBoxNetNAT if running
62terminate_proc VBoxNetNAT
63delrunlevel vboxballoonctrl-service
64remove_init_script vboxballoonctrl-service
65delrunlevel vboxautostart-service
66remove_init_script vboxautostart-service
67delrunlevel vboxweb-service
68remove_init_script vboxweb-service
69# Stop kernel module and uninstall runlevel script
70stop_init_script vboxdrv >/dev/null 2>&1
71delrunlevel vboxdrv
72remove_init_script vboxdrv
73# And do final clean-up
74"${MY_PATH}/vboxdrv.sh" cleanup >/dev/null # Do not silence errors for now
75# Stop host networking and uninstall runlevel script (obsolete)
76stop_init_script vboxnet >/dev/null 2>&1
77delrunlevel vboxnet >/dev/null 2>&1
78remove_init_script vboxnet >/dev/null 2>&1
79finish_init_script_install
80rm -f /sbin/vboxconfig
81exit 0
Note: See TracBrowser for help on using the repository browser.

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