diff options
author | Sergey Popov <pinkbyte@gentoo.org> | 2013-01-03 20:54:21 +0000 |
---|---|---|
committer | Sergey Popov <pinkbyte@gentoo.org> | 2013-01-03 20:54:21 +0000 |
commit | b469c611e3c1945950b3b2578cab562e109c994e (patch) | |
tree | 6ece21937a87735060a8489de78bb70eef113d52 /sys-cluster/vzctl | |
parent | Ignore __restrict__ field w/patch from ChromiumOS. (diff) | |
download | gentoo-2-b469c611e3c1945950b3b2578cab562e109c994e.tar.gz gentoo-2-b469c611e3c1945950b3b2578cab562e109c994e.tar.bz2 gentoo-2-b469c611e3c1945950b3b2578cab562e109c994e.zip |
Fix initscript paths, wrt bug #444201. Patch by Kir Kolyshkin. Drop old revisions
(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'sys-cluster/vzctl')
-rw-r--r-- | sys-cluster/vzctl/ChangeLog | 10 | ||||
-rw-r--r-- | sys-cluster/vzctl/files/vzctl-3.3-initscript-paths.patch | 142 | ||||
-rw-r--r-- | sys-cluster/vzctl/vzctl-3.3-r2.ebuild (renamed from sys-cluster/vzctl/vzctl-3.3-r1.ebuild) | 7 | ||||
-rw-r--r-- | sys-cluster/vzctl/vzctl-3.3.ebuild | 64 |
4 files changed, 156 insertions, 67 deletions
diff --git a/sys-cluster/vzctl/ChangeLog b/sys-cluster/vzctl/ChangeLog index 8b11fc9838f8..0f327819b9e2 100644 --- a/sys-cluster/vzctl/ChangeLog +++ b/sys-cluster/vzctl/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-cluster/vzctl # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.101 2013/01/03 20:18:54 pinkbyte Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.102 2013/01/03 20:54:21 pinkbyte Exp $ + +*vzctl-3.3-r2 (03 Jan 2013) + + 03 Jan 2013; Sergey Popov <pinkbyte@gentoo.org> -vzctl-3.3.ebuild, + -vzctl-3.3-r1.ebuild, +vzctl-3.3-r2.ebuild, + +files/vzctl-3.3-initscript-paths.patch: + Fix initscript paths, wrt bug #444201. Patch by Kir Kolyshkin. Drop old + revisions 03 Jan 2013; Sergey Popov <pinkbyte@gentoo.org> metadata.xml: Add upstream info, fix typo diff --git a/sys-cluster/vzctl/files/vzctl-3.3-initscript-paths.patch b/sys-cluster/vzctl/files/vzctl-3.3-initscript-paths.patch new file mode 100644 index 000000000000..8fc0b12009b4 --- /dev/null +++ b/sys-cluster/vzctl/files/vzctl-3.3-initscript-paths.patch @@ -0,0 +1,142 @@ +From: Kir Kolyshkin <kir@openvz.org> +Date: Thu, 3 Jan 2013 19:37:00 +0000 (-0800) +Subject: init.d/vz-gentoo: don't call tools by absolute path +X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=2fc34ffb5f5e;hp=9a4a85397f7dd99e2c4059de7fb6ef5d750242c5 + +init.d/vz-gentoo: don't call tools by absolute path + +Apparently in recent Gentoo the ip tool was moved from /sbin to /bin, +so this initscript stopped working. + +Apparently runscript makes sure all the needed directories are in PATH +(I have tested with runscript from baselayout-1.12.11.1, pretty old one) +so we can just drop the /sbin/ prefix. + +While at it, do it not only for ip, but also for modprobe and sysctl. + +http://bugzilla.openvz.org/2477 +https://bugs.gentoo.org/show_bug.cgi?id=444201 + +Reported-by: Andrei Vinogradov <spamslepnoga@inbox.ru> +Reported-by: Joakim <moonwalker@astro.nu> +Signed-off-by: Kir Kolyshkin <kir@openvz.org> +--- + +diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in +index 2dd2186..51231bc 100755 +--- a/etc/init.d/vz-gentoo.in ++++ b/etc/init.d/vz-gentoo.in +@@ -87,7 +87,7 @@ start_net() { + + # load necessary modules + for mod in ${NET_MODULES}; do +- /sbin/modprobe ${mod} 2>/dev/null ++ modprobe ${mod} 2>/dev/null + done + + if [ ! -f ${VZVEINFO} ]; then +@@ -95,22 +95,22 @@ start_net() { + fi + + # we don't operate on a running interface +- if /sbin/ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then ++ if ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then + return 0 + fi + + # configure the device + ebegin "Bringing up interface ${VZDEV}" +- /sbin/ip link set ${VZDEV} up ++ ip link set ${VZDEV} up + eend $? + +- /sbin/ip addr add 0.0.0.0/0 dev ${VZDEV} ++ ip addr add 0.0.0.0/0 dev ${VZDEV} + + ebegin "Configuring interface ${VZDEV}" +- /sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0 ++ sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0 + eend $? + +- if [ "x$(/sbin/sysctl -n -e net.ipv4.ip_forward)" != "x1" ]; then ++ if [ "x$(sysctl -n -e net.ipv4.ip_forward)" != "x1" ]; then + ewarn "It looks like you have ip forwarding disabled. To make networking" + ewarn "available for containers, please, run sysctl -w net.ipv4.ip_forward=1" + fi +@@ -119,15 +119,15 @@ start_net() { + stop_net() { + local mod + +- if /sbin/ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then ++ if ip addr list | grep -q "venet0:.*UP" 2>/dev/null; then + ebegin "Bringing down interface ${VZDEV}" +- /sbin/ip link set ${VZDEV} down 2>/dev/null ++ ip link set ${VZDEV} down 2>/dev/null + eend $? + fi + + # remove all modules we probably loaded on start_net + for mod in ${NET_MODULES}; do +- /sbin/modprobe -r ${mod} > /dev/null 2>&1 ++ modprobe -r ${mod} > /dev/null 2>&1 + done + } + +@@ -146,7 +146,7 @@ start_ve() { + # Then sort by bootorder + test -n "$velist" && velist=$(vzlist -aH -octid -s-bootorder $velist) + +- /sbin/sysctl -q -w net.ipv4.route.src_check=0 ++ sysctl -q -w net.ipv4.route.src_check=0 + + for veid in ${velist}; do + ebegin "Starting CT ${veid}" +@@ -302,16 +302,16 @@ start() { + + ebegin "Loading OpenVZ modules" + for mod in ${IPTABLES_MODULES}; do +- /sbin/modprobe ${mod} >/dev/null 2>&1 ++ modprobe ${mod} >/dev/null 2>&1 + done + + for mod in ${PRELOAD_MODULES}; do +- /sbin/modprobe -r ${mod} >/dev/null 2>&1 +- /sbin/modprobe ${mod} >/dev/null 2>&1 ++ modprobe -r ${mod} >/dev/null 2>&1 ++ modprobe ${mod} >/dev/null 2>&1 + done + + for mod in ${MODULES}; do +- /sbin/modprobe ${mod} >/dev/null 2>&1 ++ modprobe ${mod} >/dev/null 2>&1 + rc=$? + if [ ${rc} -ne 0 ]; then + eend ${rc} "failed to load module ${mod}" +@@ -320,7 +320,7 @@ start() { + done + + for mod in ${MIGRATE_MODULES} ${PLOOP_MODULES}; do +- /sbin/modprobe ${mod} >/dev/null 2>&1 ++ modprobe ${mod} >/dev/null 2>&1 + done + eend + +@@ -365,15 +365,15 @@ stop() { + stop_net + + for mod in ${MIGRATE_MODULES} ${PLOOP_MODULES}; do +- /sbin/modprobe -r ${mod} > /dev/null 2>&1 ++ modprobe -r ${mod} > /dev/null 2>&1 + done + + for mod in ${MODULES}; do +- /sbin/modprobe -r ${mod} > /dev/null 2>&1 ++ modprobe -r ${mod} > /dev/null 2>&1 + done + + for mod in ${PRELOAD_MODULES}; do +- /sbin/modprobe -r ${mod} > /dev/null 2>&1 ++ modprobe -r ${mod} > /dev/null 2>&1 + done + + # Even if some modules failed to unload (say they were not loaded) diff --git a/sys-cluster/vzctl/vzctl-3.3-r1.ebuild b/sys-cluster/vzctl/vzctl-3.3-r2.ebuild index 890cbb5f33f3..8bbabbd8de63 100644 --- a/sys-cluster/vzctl/vzctl-3.3-r1.ebuild +++ b/sys-cluster/vzctl/vzctl-3.3-r2.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.3-r1.ebuild,v 1.3 2012/12/11 18:17:36 axs Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.3-r2.ebuild,v 1.1 2013/01/03 20:54:21 pinkbyte Exp $ EAPI="4" @@ -30,6 +30,9 @@ src_prepare() { sed -e 's:=redhat-:=gentoo-:' -i etc/dists/default || die sed -i -e "s:/lib/udev:$(udev_get_udevdir):" src/lib/dev.c || die + + # Fix paths in initscript, wrt bug #444201 + epatch "${FILESDIR}/${P}-initscript-paths.patch" } src_configure() { diff --git a/sys-cluster/vzctl/vzctl-3.3.ebuild b/sys-cluster/vzctl/vzctl-3.3.ebuild deleted file mode 100644 index 24508f8bd4d2..000000000000 --- a/sys-cluster/vzctl/vzctl-3.3.ebuild +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.3.ebuild,v 1.2 2012/12/10 13:06:59 pinkbyte Exp $ - -EAPI="4" - -inherit bash-completion-r1 eutils - -DESCRIPTION="OpenVZ ConTainers control utility" -HOMEPAGE="http://openvz.org/" -SRC_URI="http://download.openvz.org/utils/${PN}/${PV}/src/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -RDEPEND=" - net-firewall/iptables - sys-apps/ed - sys-apps/iproute2 - sys-fs/vzquota - <sys-cluster/ploop-1.5" - -DEPEND="${RDEPEND}" - -src_prepare() { - # Set default OSTEMPLATE on gentoo added - sed -e 's:=redhat-:=gentoo-:' -i etc/dists/default || die - sed -e '/udevdir/{s|$(sysconfdir)|/lib|}' -i etc/udev/Makefile.in || die -} - -src_configure() { - econf \ - --localstatedir=/var \ - --enable-udev \ - --enable-bashcomp \ - --enable-logrotate -} - -src_install() { - emake DESTDIR="${D}" install install-gentoo - - # install the bash-completion script into the right location - rm -rf "${ED}"/etc/bash_completion.d - newbashcomp etc/bash_completion.d/vzctl.sh ${PN} - - # We need to keep some dirs - keepdir /vz/{dump,lock,root,private,template/cache} - keepdir /etc/vz/names /var/lib/vzctl/veip -} - -pkg_postinst() { - ewarn "To avoid loosing network to CTs on iface down/up, please, add the" - ewarn "following code to /etc/conf.d/net:" - ewarn " postup() {" - ewarn " /usr/sbin/vzifup-post \${IFACE}" - ewarn " }" - - ewarn "Starting with 3.0.25 there is new vzeventd service to reboot CTs." - ewarn "Please, drop /usr/share/vzctl/scripts/vpsnetclean and" - ewarn "/usr/share/vzctl/scripts/vpsreboot from crontab and use" - ewarn "/etc/init.d/vzeventd." -} |