summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heim <phreak@gentoo.org>2006-11-05 10:10:25 +0000
committerChristian Heim <phreak@gentoo.org>2006-11-05 10:10:25 +0000
commitc6da0c2272893d7bd3100209d4b1f6368e57e213 (patch)
tree5c738c90d1e9f368129f13cbdb3ede74ad83f607
parentAdding more patches from UPSTREAM, gentoo-tools will be in the next UPSTREAM ... (diff)
downloadmisc-c6da0c2272893d7bd3100209d4b1f6368e57e213.tar.gz
misc-c6da0c2272893d7bd3100209d4b1f6368e57e213.tar.bz2
misc-c6da0c2272893d7bd3100209d4b1f6368e57e213.zip
Adding Benedikt's updated init-scripts, deprecating the old one.
svn path=/; revision=520
-rwxr-xr-xutil-vserver/init.d/vprocunhide20
-rwxr-xr-xutil-vserver/init.d/vservers107
-rwxr-xr-xutil-vserver/init.d/vservers.default15
3 files changed, 35 insertions, 107 deletions
diff --git a/util-vserver/init.d/vprocunhide b/util-vserver/init.d/vprocunhide
new file mode 100755
index 0000000..d7199ca
--- /dev/null
+++ b/util-vserver/init.d/vprocunhide
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+ if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
+ eerror "Cannot find util-vserver installation"
+ eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
+ return 1
+ fi
+
+ source ${UTIL_VSERVER_VARS}
+
+ ebegin "Fixing /proc entries visibility"
+ ${_VPROCUNHIDE}
+ eend $?
+}
+
+# vim:ts=4:filetype=gentoo-init-d
diff --git a/util-vserver/init.d/vservers b/util-vserver/init.d/vservers
deleted file mode 100755
index 52c1cd7..0000000
--- a/util-vserver/init.d/vservers
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-opts="${opts} vstatus"
-
-checkconfig() {
- : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
- if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
- eerror "Cannot find util-vserver installation"
- eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
- exit 1
- fi
-
- source ${UTIL_VSERVER_VARS}
- source ${_LIB_GENTOO_FUNCTIONS}
-
- : ${MARKS:=default}
- : ${NUMPARALLEL:=1}
- : ${LOCKDIR:=/var/lock/vservers}
-}
-
-start() {
- checkconfig
-
- ebegin "Unhiding /proc entries"
- ${_VPROCUNHIDE}
- eend $?
-
- if [[ -n ${STARTALL} ]]; then
- ebegin "Starting all types of vservers"
- ${_START_VSERVERS} -j ${NUMPARALLEL} --all --start
- local rc=$?
- [[ $rc -eq 0 ]] && touch ${LOCKDIR}/all
- eend $rc
- else
- for MARK in ${MARKS}; do
- ebegin "Starting vservers of type '${MARK}'"
- ${_START_VSERVERS} -m ${MARK} -j ${NUMPARALLEL} --all --start
- local rc=$?
- [[ $rc -eq 0 ]] && touch ${LOCKDIR}/${MARK}
- eend $rc
- done
- fi
-
- for VSERVER in ${START_VSERVERS}; do
- ebegin "Starting single vserver '${VSERVER}'"
- ${_VSERVER} ${VSERVER} start
- eend $?
- done
-}
-
-stop() {
- checkconfig
-
- ebegin "Stopping all types of vservers"
- ${_START_VSERVERS} -j ${NUMPARALLEL} --all --stop
- eend $?
-
- rm -f ${LOCKDIR}/*
-
- einfo "Checking for vservers still running ..."
-
- for i in $(vs_running_name 1); do
- ebegin " Stopping single vserver: ${i}"
- /usr/sbin/vserver ${i} stop &> /dev/null
- eend $?
- done
-}
-
-vstatus() {
- checkconfig
-
- local running="false"
-
- einfo "${LOCKDIR} shows the following types of vservers running:"
-
- for i in $( ls ${LOCKDIR} | sort ); do
- einfo " ${i}"
- running="true"
- done
-
- if [[ "${running}" != "true" ]]; then
- einfo " none"
- fi
-
- running="false"
-
- einfo
- einfo "/proc/virtual/ says these are running:"
-
- for i in $(vs_running_name 1); do
- einfo " ${i}"
- running="true"
- done
-
- if [[ "${running}" != "true" ]]; then
- einfo " none"
- fi
-
-
- einfo
- einfo "vserver-stat says these are running:"
- /usr/sbin/vserver-stat
-}
-
-# vim:ts=4:filetype=gentoo-init-d
diff --git a/util-vserver/init.d/vservers.default b/util-vserver/init.d/vservers.default
new file mode 100755
index 0000000..52eb322
--- /dev/null
+++ b/util-vserver/init.d/vservers.default
@@ -0,0 +1,15 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ MARK=${0##*/vserver.} /usr/lib/util-vserver/vserver-wrapper start
+}
+
+stop() {
+ MARK=${0##*/vserver.} /usr/lib/util-vserver/vserver-wrapper stop
+}
+
+
+
+# vim:ts=4:filetype=gentoo-init-d