Annotation of /trunk/virtualbox/virtualbox-guest.rc
Parent Directory | Revision Log
Revision 1380 -
(hide annotations)
(download)
Wed Jun 29 23:15:24 2011 UTC (13 years, 3 months ago) by niro
File size: 1238 byte(s)
Wed Jun 29 23:15:24 2011 UTC (13 years, 3 months ago) by niro
File size: 1238 byte(s)
-use rc_print
1 | niro | 1070 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-guest.rc,v 1.1 2010-08-09 20:31:47 niro Exp $ | ||
3 | |||
4 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k | ||
5 | #%start: 80 | ||
6 | #%stop: 10 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/conf.d/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | case "$1" in | ||
17 | start) | ||
18 | niro | 1380 | rc_print "Starting VirtualBox guest additions ..." |
19 | niro | 1070 | |
20 | # load kernel modules | ||
21 | /sbin/modprobe vboxguest &> /dev/null | ||
22 | /sbin/modprobe vboxsf &> /dev/null | ||
23 | |||
24 | start-stop-daemon --start --make-pidfile \ | ||
25 | --exec /usr/sbin/vboxguest-service --pidfile /var/run/vboxguest-service.pid \ | ||
26 | --name vboxguest-service --background -- --foreground | ||
27 | evaluate_retval | ||
28 | |||
29 | update_svcstatus $1 | ||
30 | splash svc_started "$(basename $0)" 0 | ||
31 | ;; | ||
32 | |||
33 | stop) | ||
34 | niro | 1380 | rc_print "Stopping VirtualBox guest additions ..." |
35 | niro | 1070 | start-stop-daemon --stop --quiet --pidfile /var/run/vboxguest-service.pid --name vboxguest-service |
36 | evaluate_retval | ||
37 | |||
38 | # remove kernel modules | ||
39 | /sbin/modprobe -r vboxsf &> /dev/null | ||
40 | /sbin/modprobe -r vboxguest &> /dev/null | ||
41 | |||
42 | update_svcstatus $1 | ||
43 | splash svc_stopped "$(basename $0)" 0 | ||
44 | ;; | ||
45 | |||
46 | restart) | ||
47 | $0 stop | ||
48 | sleep 1 | ||
49 | $0 start | ||
50 | ;; | ||
51 | |||
52 | status) | ||
53 | statusproc /usr/sbin/vboxguest-service | ||
54 | ;; | ||
55 | |||
56 | *) | ||
57 | niro | 1380 | rc_echo "Usage: $0 {start|stop|restart|status}" |
58 | niro | 1070 | exit 1 |
59 | ;; | ||
60 | esac |