Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/virtualbox-guest-additions/files: virtualbox-guest-additions-3.initd
Date: Thu, 16 Jul 2009 21:42:11
Message-Id: E1MRYiO-0006By-DC@stork.gentoo.org
1 patrick 09/07/16 21:42:08
2
3 Added: virtualbox-guest-additions-3.initd
4 Log:
5 Bump to 3.0.2. Fixes #275963. Thanks to Alessio Cassiba and all the testers
6 (Portage version: 2.2_rc33/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3.initd?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3.initd?rev=1.1&content-type=text/plain
13
14 Index: virtualbox-guest-additions-3.initd
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2009 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header:
20
21 depend() {
22 need localmount
23 before xdm
24 }
25
26 createvboxdevice() {
27 local maj min
28
29 maj=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/devices`
30
31 if ! [[ -z $maj ]] ; then
32 min=0
33 else
34 min=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/misc`
35 if ! [[ -z $min ]] ; then
36 maj=10
37 fi
38 fi
39
40 mknod /dev/vboxadd c $maj $min -m 0664 &> /dev/null
41 }
42
43 start() {
44 ebegin "Starting VirtualBox guest additions"
45
46 if [[ -e /dev/vboxadd ]] ; then
47 rm -f /dev/vboxadd &> /dev/null
48 fi
49
50 einfo " Loading kernel modules and creating devices"
51 /sbin/modprobe vboxadd &> /dev/null
52 createvboxdevice
53 /sbin/modprobe vboxvfs &> /dev/null
54
55 einfo " Starting the vboxadd system service"
56 start-stop-daemon --start --make-pidfile \
57 --exec /usr/sbin/vboxadd-service --pidfile /var/run/vboxadd-service.pid \
58 --name vboxadd-service \
59 --background
60
61 eend $? "Failed to start VirtualBox guest additions"
62 }
63
64 stop() {
65 ebegin "Stopping VirtualBox guest additions"
66
67 einfo " Stopping the vboxadd system service"
68 start-stop-daemon --stop --quiet \
69 --pidfile /var/run/vboxadd-service.pid --name vboxadd-service
70
71 einfo " Unloading kernel modules and removing devices"
72 /sbin/rmmod vboxvfs &> /dev/null
73 /sbin/rmmod vboxadd &> /dev/null
74 rm -f /dev/vboxadd &> /dev/null
75 eend $?
76 }