gentoo: do not mess with the cgroup mount at boot time. openrc takes care of this...
[util-vserver.git] / gentoo / util-vserver
1 #!/sbin/runscript
2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 start() {
6         : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
7         if [ ! -e ${UTIL_VSERVER_VARS} ]; then
8                 eerror "Cannot find util-vserver installation"
9                 eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
10                 return 1
11         fi
12         
13         . ${UTIL_VSERVER_VARS}
14
15         ebegin "Creating directories for $PACKAGE_NAME"
16     $__PKGLIBDIR/bash-wrapper 'create_dirs'
17         eend $?
18
19         ebegin "Setting vshelper path to $_VSHELPER"
20     $__PKGLIBDIR/bash-wrapper 'set_helper'
21         eend $?
22
23         ebegin "Loading default device map"
24         $__PKGLIBDIR/bash-wrapper 'handleDeviceMap --set 0 "$__CONFDIR/.defaults/apps/vdevmap"'
25         eend $?
26 }
27
28 stop() {
29         : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
30         if [ ! -e ${UTIL_VSERVER_VARS} ]; then
31                 eerror "Cannot find util-vserver installation"
32                 eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
33                 return 1
34         fi
35         
36         . ${UTIL_VSERVER_VARS}
37
38         ebegin "Stopping all running guests"
39         $_START_VSERVERS -j 1 --all --stop
40         eend $?
41
42         ebegin "Killing all running contexts"
43         $__PKGLIBDIR/bash-wrapper 'kill_contexts'
44         eend $?
45 }
46
47 # vim:ts=4:filetype=gentoo-init-d