initial ebuild
authorBenedikt Boehm <hollow@gentoo.org>
Mon, 26 Sep 2005 15:32:35 +0000 (15:32 +0000)
committerBenedikt Boehm <hollow@gentoo.org>
Mon, 26 Sep 2005 15:32:35 +0000 (15:32 +0000)
Package-Manager: portage-2.0.52-r1

sys-cluster/vzctl/ChangeLog [new file with mode: 0644]
sys-cluster/vzctl/Manifest [new file with mode: 0644]
sys-cluster/vzctl/files/digest-vzctl-2.7.0.21 [new file with mode: 0644]
sys-cluster/vzctl/files/vz.initd [new file with mode: 0644]
sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_conf_d.patch [new file with mode: 0644]
sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_etc_vz.patch [new file with mode: 0644]
sys-cluster/vzctl/metadata.xml [new file with mode: 0644]
sys-cluster/vzctl/vzctl-2.7.0.21.ebuild [new file with mode: 0644]

diff --git a/sys-cluster/vzctl/ChangeLog b/sys-cluster/vzctl/ChangeLog
new file mode 100644 (file)
index 0000000..99c296d
--- /dev/null
@@ -0,0 +1,12 @@
+# ChangeLog for sys-cluster/vzctl
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.1 2005/09/26 15:32:35 hollow Exp $
+
+*vzctl-2.7.0.21 (26 Sep 2005)
+
+  26 Sep 2005; Benedikt Boehm <hollow@gentoo.org>
+  +files/vzctl-2.7.0-gentoo_conf_d.patch,
+  +files/vzctl-2.7.0-gentoo_etc_vz.patch, +files/vz.initd, +metadata.xml,
+  +vzctl-2.7.0.21.ebuild:
+  Initial release. thx to kir
+
diff --git a/sys-cluster/vzctl/Manifest b/sys-cluster/vzctl/Manifest
new file mode 100644 (file)
index 0000000..1504e33
--- /dev/null
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 4c47d1de29c532cfc43615c24690b8f1 vzctl-2.7.0.21.ebuild 1578
+MD5 b55bfb88b955107a0f0e6c5aaef21723 metadata.xml 162
+MD5 7a5658db307cd943c3aca339f3b112db ChangeLog 461
+MD5 687eaa4427600a7a5edfc0b8b7f69480 files/vzctl-2.7.0-gentoo_conf_d.patch 3899
+MD5 9ab78117d5f3fb123a7c44f948aafb3d files/vzctl-2.7.0-gentoo_etc_vz.patch 7412
+MD5 a2de79b189da1c2d3fd01fa2116bcea9 files/vz.initd 5465
+MD5 59b8869cf562ff10c9561f1f38cd37cc files/digest-vzctl-2.7.0.21 66
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDOBUDmPFBzbX68WERAiGxAJ0dYNFEa16XTfHTsVDiImDwM5jPkwCgg+e0
+UJNwqM1H+iTXz8dUUKR6hRw=
+=NzrC
+-----END PGP SIGNATURE-----
diff --git a/sys-cluster/vzctl/files/digest-vzctl-2.7.0.21 b/sys-cluster/vzctl/files/digest-vzctl-2.7.0.21
new file mode 100644 (file)
index 0000000..a2bd4f1
--- /dev/null
@@ -0,0 +1 @@
+MD5 1578c8b5f1c5f1f527cee8a00771ca45 vzctl-2.7.0-21.tar.bz2 96125
diff --git a/sys-cluster/vzctl/files/vz.initd b/sys-cluster/vzctl/files/vz.initd
new file mode 100644 (file)
index 0000000..665be64
--- /dev/null
@@ -0,0 +1,245 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/files/vz.initd,v 1.1 2005/09/26 15:32:35 hollow Exp $
+
+depend() {
+       need net
+       before iptables
+}
+
+check_config() {
+       # if we don't want openvz running, say so
+       [ "${VIRTUOZZO}" = "yes" ] || return 1
+       
+       # set default values
+       : ${VZCTL:=/usr/sbin/vzctl}
+       : ${VZQUOTA:=/usr/sbin/vzquota}
+       : ${VZVEINFO:=/proc/vz/veinfo}
+       : ${VPSCONFDIR:=/etc/vz}
+       : ${PRELOAD_MODULES:="af_packet"}
+       : ${MODULES:="vzmon vzdquota vzdev"}
+       : ${NET_MODULES="vznetdev vznet"}
+       : ${VZDEV:=venet0}
+       : ${PARALLEL:=4}
+       
+       # check if you should load vzwdog module
+       [ "${VZWDOG}" = "yes" ] && MODULES="${MODULES} vzwdog"
+       
+       # we need a working vzctl
+       if [ ! -x "${VZCTL}" ]; then
+               eerror "vzctl missing (${VZCTL})"
+               return 1
+       fi
+       
+       # prevent dumb users from failure
+       if [ ! -e /dev/vzctl ]; then
+               eerror "Missing device node /dev/vzctl"
+               einfo
+               einfo "Please create the vzctl device node using the following command:"
+               einfo "   /bin/mknod /dev/vzctl c 126 0"
+               einfo
+               return 1
+       fi
+       
+       if [ -z "${VE0CPUUNITS}" ]; then
+               ewarn "VE0CPUUNITS is not set in /etc/conf.d/vz; using default value of 1000"
+               VE0CPUUNITS=1000
+       fi
+       return 0
+}
+
+start_net() {
+       local mod
+       
+       # we don't operate on a running interface
+       if /sbin/ip addr ls | grep -q "venet0:.*UP" 2>/dev/null; then
+               return 0
+       fi
+       
+       # load necessary modules
+       for mod in ${NET_MODULES}; do
+               /sbin/modprobe ${mod} 2>/dev/null
+       done
+       
+       # configure the device
+       ebegin "Bringing up interface ${VZDEV}"
+               /sbin/ip link set ${VZDEV} up
+       eend $?
+       
+       /sbin/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
+       eend $?
+}
+
+stop_net() {
+       local mod
+
+       if /sbin/ip a l | grep -q "venet0:.*UP" 2>/dev/null; then
+               ebegin "Bringing down interface ${VZDEV}"
+                       /sbin/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
+       done
+}
+
+start_ve() {
+       local veid velist msg need_restart=""
+       
+       # get all VPSs we should start on boot
+       if ! cd ${VPSCONFDIR}; then
+               eerror $? "Unable to cd to ${VPSCONFDIR}"
+               return 1
+       fi
+       velist=$(grep -l '^ONBOOT=yes\|^ONBOOT=\"yes\"' [0-9]*.conf 2>/dev/null | sed -e 's/.conf//g' | sort -n)
+       cd - >/dev/null
+       
+       /sbin/sysctl -q -w net.ipv4.route.src_check=0
+       
+       for veid in ${velist}; do
+               ebegin "Starting VPS ${veid}"
+               if [ "${VZFASTBOOT}" = "yes" -a "${DISK_QUOTA}" = "yes" ]; then
+                       ${VZQUOTA} stat ${veid} >/dev/null 2>&1
+                       if [ $? -eq 6 ]; then
+                               if ${VZQUOTA} show ${veid} 2>&1 | grep "vzquota : (warning) Quota is running" >/dev/null 2>&1; then
+                                       ${VZQUOTA} on ${veid} --nocheck >/dev/null 2>&1
+                                       need_restart="${need_restart} ${veid}"
+                               fi
+                       fi
+               fi
+               msg=$(${VZCTL} start ${veid} 2>&1)
+               eend $? "${msg}"
+       done
+       
+       for veid in ${need_restart}; do
+               ebegin "Stopping VPS ${veid}"
+               msg=$(${VZCTL} stop ${veid})
+               eend $? "${msg}"
+               
+               ebegin "Starting VPS ${veid}"
+               msg=$($VZCTL start ${veid} 2>&1)
+               eend $? "${msg}"
+       done
+       
+       # we're ok even if some VPSs failed to start
+       return 0
+}
+
+stop_ve() {
+       local veid velist msg m mounts fail i iter pid pids quota
+
+       if [ -f ${VZVEINFO} ]; then
+               for ((i = 0; i <= 2; i++)); do
+                       iter=0
+                       pids=
+                       velist=$(awk  '{print $1;}' < ${VZVEINFO} | grep -v "^0$")
+                       
+                       for veid in ${velist}; do
+                               ebegin "Shutting down VPS $veid"
+                               # Set fairsched parameters to maximum so
+                               # VPS will stop fast
+                               ${VZCTL} set ${veid} --cpuunits 2000 --cpulimit 0 >/dev/null 2>&1
+                               ${VZCTL} --skiplock stop ${veid} >/dev/null 2>&1 &
+                               pids="${pids} $!"
+                               let iter++
+                               sleep 1
+                               if [ ${iter} -gt ${PARALLEL} ]; then
+                                       for pid in ${pids}; do
+                                               wait ${pid}
+                                       done
+                                       pids=
+                                       iter=0
+                               fi
+                       done
+                       
+                       for pid in ${pids}; do
+                               wait ${pid}
+                       done
+               done
+       fi
+       
+       iter=0
+       fail=1
+       
+       while [ ${iter} -lt 5 -a ${fail} -ne 0 ]; do
+               fail=0
+               mounts=$(awk '{if ($3=="simfs") print $2}' /proc/mounts)
+               
+               for m in ${mounts}; do
+                       ebegin "Unmounting VPS area ${m}"
+                       msg=$(umount ${m} 2>&1)
+                       eend $? "${msg}"
+                       if [ $? -ne 0 ]; then
+                               let fail++
+                               fuser -k -m ${m} > /dev/null 2>&1
+                       fi
+               done
+               
+               let iter++
+       done
+       
+       # turn quota off
+       quota=$(awk -F: '/^[0-9]+:/{print $1}' /proc/vz/vzquota 2>/dev/null)
+       
+       for m in ${quota}; do
+               ebegin "Turning quota off for VPS ${m}"
+               msg=$(vzquota off ${m} 2>&1)
+               eend $? "${msg}"
+       done
+}
+
+start() {
+       check_config || return
+       
+       local msg mod rc
+       
+       ebegin "Loading OpenVZ modules"
+       for mod in ${PRELOAD_MODULES}; do
+               /sbin/modprobe -r ${mod} >/dev/null 2>&1
+               /sbin/modprobe ${mod} >/dev/null 2>&1
+       done
+       
+       for mod in ${MODULES}; do
+               /sbin/modprobe ${mod} >/dev/null 2>&1
+               rc=$?
+               if [ ${rc} -ne 0 ]; then
+                       eend ${rc} "failed to load module ${mod}"
+                       return ${rc}
+               fi
+       done
+       eend
+       
+       start_net
+       
+       msg=$(${VZCTL} set 0 --cpuunits ${VE0CPUUNITS} 2>&1)
+       [ $? -ne 0 ] && ewarn "vzctl set 0 --cpuunits ${VE0CPUUNITS} failed: ${msg}"
+       
+       start_ve
+}
+
+stop() {
+       check_config || return
+       
+       local mod
+       
+       stop_ve
+       stop_net
+       
+       for mod in ${MODULES}; do
+               /sbin/modprobe -r ${mod} > /dev/null 2>&1
+       done
+       
+       for mod in ${PRELOAD_MODULES}; do
+               /sbin/modprobe -r ${mod} > /dev/null 2>&1
+       done
+       
+       # Even if some modules failed to unload (say they were not loaded)
+       # we return 0 for the service to be marked as stopped.
+       return 0
+}
diff --git a/sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_conf_d.patch b/sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_conf_d.patch
new file mode 100644 (file)
index 0000000..b5d3cfa
--- /dev/null
@@ -0,0 +1,112 @@
+diff -ur vzctl-2.7.0-21/etc/vpsnetclean vzctl-2.7.0-21-gentoo/etc/vpsnetclean
+--- vzctl-2.7.0-21/etc/vpsnetclean     2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/etc/vpsnetclean      2005-09-23 00:43:35.000000000 +0400
+@@ -17,7 +17,7 @@
+ VE_RUN=
+ VE_PREV=
+ 
+-. /etc/sysconfig/vz
++. /etc/conf.d/vz
+ 
+ 
+ #
+diff -ur vzctl-2.7.0-21/etc/vpsreboot vzctl-2.7.0-21-gentoo/etc/vpsreboot
+--- vzctl-2.7.0-21/etc/vpsreboot       2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/etc/vpsreboot        2005-09-23 00:42:56.000000000 +0400
+@@ -16,8 +16,8 @@
+ REBOOT_MARK='reboot'
+ LOCKFILE='/var/lock/vereboot.lock'
+ 
+-[ -f /etc/sysconfig/vz ] || exit
+-. /etc/sysconfig/vz
++[ -f /etc/conf.d/vz ] || exit
++. /etc/conf.d/vz
+ 
+ function check_reboot()
+ {
+@@ -28,7 +28,7 @@
+       VEID=${veid}
+       [ -f "${CONF_DIR}/${veid}.conf" ] || return
+       eval ` (
+-              . /etc/sysconfig/vz;
++              . /etc/conf.d/vz;
+               . ${CONF_DIR}/${veid}.conf;
+               echo ve_root=${VE_ROOT}\;;
+               echo allowreboot=${ALLOWREBOOT}\;;
+diff -ur vzctl-2.7.0-21/include/types.h vzctl-2.7.0-21-gentoo/include/types.h
+--- vzctl-2.7.0-21/include/types.h     2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/include/types.h      2005-09-23 00:48:31.000000000 +0400
+@@ -11,7 +11,7 @@
+ #ifndef       _TYPES_H_
+ #define       _TYPES_H_
+ 
+-#define GLOBAL_CFG              "/etc/sysconfig/vz"
++#define GLOBAL_CFG              "/etc/conf.d/vz"
+ #define VPS_CONF_DIR            "/etc/sysconfig/vz-scripts/"
+ #define LIB_DIR                       "/usr/lib/vzctl/lib/"
+ #define VPS_SCRIPTS_DIR         "/usr/lib/vzctl/scripts/"
+diff -ur vzctl-2.7.0-21/include/vzlist.h vzctl-2.7.0-21-gentoo/include/vzlist.h
+--- vzctl-2.7.0-21/include/vzlist.h    2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/include/vzlist.h     2005-09-23 19:50:57.549383320 +0400
+@@ -26,7 +26,7 @@
+ #define PROCFSHED     "/proc/fairsched"
+ 
+ #define SCRIPT_DIR    "/etc/sysconfig/vz-scripts/"
+-#define CFG_FILE      "/etc/sysconfig/vz"
++#define CFG_FILE      "/etc/conf.d/vz"
+ #define VZQUOTA               "/usr/sbin/vzquota"
+ 
+ #define MAXCPUUNITS   500000
+diff -ur vzctl-2.7.0-21/man/vz.5 vzctl-2.7.0-21-gentoo/man/vz.5
+--- vzctl-2.7.0-21/man/vz.5    2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/man/vz.5     2005-09-23 00:47:11.000000000 +0400
+@@ -2,7 +2,7 @@
+ .SH NAME
+ vz \- global Open Virtuozzo configuration file
+ .SH SYNOPSIS
+-/etc/sysconfig/vz
++/etc/conf.d/vz
+ .SH DESCRIPTION
+ This is global configuration file for Open Virtuozzo.
+ It consists of lines in the form
+diff -ur vzctl-2.7.0-21/man/vzctl.8 vzctl-2.7.0-21-gentoo/man/vzctl.8
+--- vzctl-2.7.0-21/man/vzctl.8 2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/man/vzctl.8  2005-09-23 00:47:29.000000000 +0400
+@@ -421,7 +421,7 @@
+ .SH FILES
+ .ad l
+ \f(CR
+-/etc/sysconfig/vz
++/etc/conf.d/vz
+ .br
+ /etc/sysconfig/vz-scripts/vpsid.conf
+ .br
+diff -ur vzctl-2.7.0-21/src/Makefile vzctl-2.7.0-21-gentoo/src/Makefile
+--- vzctl-2.7.0-21/src/Makefile        2005-09-12 19:23:58.000000000 +0400
++++ vzctl-2.7.0-21-gentoo/src/Makefile 2005-09-23 19:46:37.460922776 +0400
+@@ -13,7 +13,7 @@
+      SBINDIR = $(PREFIX)/sbin
+       LIBDIR = $(PREFIX)/lib/vzctl
+     CACHEDIR = /vz/template/cache
+-   GLBCONFIG = /etc/sysconfig/vz
++   VZCONFDIR = /etc/conf.d
+   VPSCONFDIR = /etc/sysconfig/vz-scripts
+  DISTCONFDIR = $(VPSCONFDIR)/dists
+ NETSCRIPTDIR = /etc/sysconfig/network-scripts
+@@ -122,7 +122,7 @@
+               $(INSTALL) ../etc/$$file $(DESTDIR)$(NETSCRIPTDIR)/$$file; \
+       done
+ inst-configs:
+-      $(INSTALL) -m 644 ../etc/vz $(DESTDIR)$(GLBCONFIG)
++      $(INSTALL) -m 644 ../etc/vz $(DESTDIR)$(VZCONFDIR)/vz
+ ifeq ($(ARCH),ia64)
+       for file in $(VECONFIG); do \
+               $(INSTALL) ../etc/$$file.ia64 $(DESTDIR)$(VPSCONFDIR)/$$file; \
+@@ -153,6 +153,7 @@
+       $(INSTALL) -d $(DESTDIR)$(VZLOCKDIR)
+       $(INSTALL) -d $(DESTDIR)$(LOGRDIR)
+       $(INSTALL) -d $(DESTDIR)$(CACHEDIR)
++      $(INSTALL) -d $(DESTDIR)$(VZCONFDIR)
+       $(INSTALL) -m 644 ../etc/logrotate.d/vzctl $(DESTDIR)$(LOGRDIR)/vzctl
+ 
+ install-lib: inst-lib
diff --git a/sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_etc_vz.patch b/sys-cluster/vzctl/files/vzctl-2.7.0-gentoo_etc_vz.patch
new file mode 100644 (file)
index 0000000..f8e2d9a
--- /dev/null
@@ -0,0 +1,173 @@
+diff -ur vzctl-2.7.0-21-gentoo/etc/cron.d/vpsnetclean vzctl-2.7.0-21-gentoo_etc_vz/etc/cron.d/vpsnetclean
+--- vzctl-2.7.0-21-gentoo/etc/cron.d/vpsnetclean       2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/etc/cron.d/vpsnetclean        2005-09-23 19:32:28.869928216 +0400
+@@ -10,5 +10,5 @@
+ # Clean VPS network rules (arp,route,iptables)
+ #
+ 
+-*/5 * * * * root /etc/sysconfig/vz-scripts/vpsnetclean
++*/5 * * * * root /etc/vz/vpsnetclean
+ 
+diff -ur vzctl-2.7.0-21-gentoo/etc/cron.d/vpsreboot vzctl-2.7.0-21-gentoo_etc_vz/etc/cron.d/vpsreboot
+--- vzctl-2.7.0-21-gentoo/etc/cron.d/vpsreboot 2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/etc/cron.d/vpsreboot  2005-09-23 19:32:40.663135376 +0400
+@@ -11,4 +11,4 @@
+ # If vzagent not installed you can enable reboot functionality by
+ # commented out the line below.
+ 
+-*/5 * * * * root /etc/sysconfig/vz-scripts/vpsreboot
++*/5 * * * * root /etc/vz/vpsreboot
+diff -ur vzctl-2.7.0-21-gentoo/etc/dists/Makefile vzctl-2.7.0-21-gentoo_etc_vz/etc/dists/Makefile
+--- vzctl-2.7.0-21-gentoo/etc/dists/Makefile   2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/etc/dists/Makefile    2005-09-23 19:33:33.289135008 +0400
+@@ -8,7 +8,7 @@
+ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ 
+ INSTALL = install
+-DISTCONFDIR = /etc/sysconfig/vz-scripts/dists
++DISTCONFDIR = /etc/vz/dists
+ DISTSCRIPTDIR = ${DISTCONFDIR}/scripts
+ DISTSCRIPTS = debian-add_ip.sh debian-del_ip.sh debian-set_hostname.sh        \
+       functions postcreate.sh redhat-7.x_add_ip.sh redhat-add_ip.sh   \
+diff -ur vzctl-2.7.0-21-gentoo/etc/vps-functions vzctl-2.7.0-21-gentoo_etc_vz/etc/vps-functions
+--- vzctl-2.7.0-21-gentoo/etc/vps-functions    2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/etc/vps-functions     2005-09-23 19:32:57.723541800 +0400
+@@ -26,7 +26,7 @@
+ 
+ # iptables parameters
+ VE_STATE_DIR="/var/vz/veip/"
+-CONF_DIR="/etc/sysconfig/vz-scripts/"
++CONF_DIR="/etc/vz/"
+ 
+ ARPSEND_CMD="arpsend -c 1 -w 1"
+ IP_CMD=/sbin/ip
+diff -ur vzctl-2.7.0-21-gentoo/etc/vpsreboot vzctl-2.7.0-21-gentoo_etc_vz/etc/vpsreboot
+--- vzctl-2.7.0-21-gentoo/etc/vpsreboot        2005-09-23 00:42:56.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/etc/vpsreboot 2005-09-23 19:33:18.666358008 +0400
+@@ -11,7 +11,7 @@
+ # Script to start VPS was rebooted
+ #
+ 
+-CONF_DIR=/etc/sysconfig/vz-scripts
++CONF_DIR=/etc/vz
+ VE_INFO=/proc/vz/veinfo
+ REBOOT_MARK='reboot'
+ LOCKFILE='/var/lock/vereboot.lock'
+diff -ur vzctl-2.7.0-21-gentoo/include/dist.h vzctl-2.7.0-21-gentoo_etc_vz/include/dist.h
+--- vzctl-2.7.0-21-gentoo/include/dist.h       2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/include/dist.h        2005-09-23 19:33:57.653431072 +0400
+@@ -23,7 +23,7 @@
+ #define       SET_UGID_QUOTA          6
+ #define       POST_CREATE             7
+ 
+-#define DIST_DIR              "/etc/sysconfig/vz-scripts/dists"
++#define DIST_DIR              "/etc/vz/dists"
+ 
+ typedef struct {
+       char *def_ostmpl;
+diff -ur vzctl-2.7.0-21-gentoo/include/types.h vzctl-2.7.0-21-gentoo_etc_vz/include/types.h
+--- vzctl-2.7.0-21-gentoo/include/types.h      2005-09-23 00:48:31.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/include/types.h       2005-09-23 19:34:10.927413120 +0400
+@@ -12,7 +12,7 @@
+ #define       _TYPES_H_
+ 
+ #define GLOBAL_CFG              "/etc/conf.d/vz"
+-#define VPS_CONF_DIR            "/etc/sysconfig/vz-scripts/"
++#define VPS_CONF_DIR            "/etc/vz/"
+ #define LIB_DIR                       "/usr/lib/vzctl/lib/"
+ #define VPS_SCRIPTS_DIR         "/usr/lib/vzctl/scripts/"
+ 
+diff -ur vzctl-2.7.0-21-gentoo/include/vzlist.h vzctl-2.7.0-21-gentoo_etc_vz/include/vzlist.h
+--- vzctl-2.7.0-21-gentoo/include/vzlist.h     2005-09-23 19:50:57.549383320 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/include/vzlist.h      2005-09-23 19:36:19.801821232 +0400
+@@ -25,7 +25,7 @@
+ #define PROCVEINFO    "/proc/vz/veinfo"
+ #define PROCFSHED     "/proc/fairsched"
+ 
+-#define SCRIPT_DIR    "/etc/sysconfig/vz-scripts/"
++#define SCRIPT_DIR    "/etc/vz/"
+ #define CFG_FILE      "/etc/conf.d/vz"
+ #define VZQUOTA               "/usr/sbin/vzquota"
+ 
+diff -ur vzctl-2.7.0-21-gentoo/man/vps.conf.5 vzctl-2.7.0-21-gentoo_etc_vz/man/vps.conf.5
+--- vzctl-2.7.0-21-gentoo/man/vps.conf.5       2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/man/vps.conf.5        2005-09-23 19:34:49.617531328 +0400
+@@ -3,10 +3,10 @@
+ .SH NAME
+ vps.conf \- configuration file for a Virtual Private Server
+ .SH SYNOPSIS
+-/etc/sysconfig/vz-scripts/XXX.conf
++/etc/vz/XXX.conf
+ .SH DESCRIPTION
+ This is a configuration file for a VPS. It is stored as
+-\fB/etc/sysconfig/vz-scripts/\fR\fIXXX\fB.conf\fR, where \fIXXX\fR
++\fB/etc/vz/\fR\fIXXX\fB.conf\fR, where \fIXXX\fR
+ is the ID of the given VPS.
+ .PP
+ Configuration file consists of lines in the form
+diff -ur vzctl-2.7.0-21-gentoo/man/vzctl.8 vzctl-2.7.0-21-gentoo_etc_vz/man/vzctl.8
+--- vzctl-2.7.0-21-gentoo/man/vzctl.8  2005-09-23 00:47:29.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/man/vzctl.8   2005-09-23 19:35:31.225206000 +0400
+@@ -319,7 +319,7 @@
+ .TP
+ \fB--applyconfig\fR \fIname\fR
+ Read VPS parameters from VPS sample configuration file
+-\f(CW\fB/etc/sysconfig/vz-scripts/ve-\fIname\fR\f(CW\fB.conf-sample\fR, and
++\f(CW\fB/etc/vz/ve-\fIname\fR\f(CW\fB.conf-sample\fR, and
+ apply them, if --save option specified save to VPS config file. These parameters
+ are not changed (\fBHOSTNAME\fR \fBIP_ADDRESS\fR \fBOSTEMPLATE\fR \fBVE_ROOT\fR \fBVE_PRIVATE\fR)
+ .SS Performing VPS actions
+@@ -329,7 +329,7 @@
+ 
+ If the \fB--config\fR \fIname\fR option is specified, values from
+ example configuration file
+-\f(CW\fB/etc/sysconfig/vz-scripts/ve-\fIname\fR\f(CW\fB.conf-sample\fR
++\f(CW\fB/etc/vz/ve-\fIname\fR\f(CW\fB.conf-sample\fR
+ are put into VPS configuration file. If VPS configuration file already exists,
+ it will be removed.
+ 
+@@ -423,7 +423,7 @@
+ \f(CR
+ /etc/conf.d/vz
+ .br
+-/etc/sysconfig/vz-scripts/vpsid.conf
++/etc/vz/vpsid.conf
+ .br
+ /proc/vz/veinfo
+ .br
+diff -ur vzctl-2.7.0-21-gentoo/man/vzsplit.8 vzctl-2.7.0-21-gentoo_etc_vz/man/vzsplit.8
+--- vzctl-2.7.0-21-gentoo/man/vzsplit.8        2005-09-23 00:42:16.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/man/vzsplit.8 2005-09-23 19:35:48.716546912 +0400
+@@ -19,7 +19,7 @@
+ .TP
+ \fB-f\fR \fIconf_name\fR
+ Specified config name. The program output will be placed to
+-/etc/sysconfig/vz-scripts/ve-\fIconf_name\fR.conf-sample.
++/etc/vz/ve-\fIconf_name\fR.conf-sample.
+ .TP
+ \fB-s\fR \fIswapsize\fR
+ Specified swap size in Kbytes. If not given swap size will be read
+diff -ur vzctl-2.7.0-21-gentoo/src/Makefile vzctl-2.7.0-21-gentoo_etc_vz/src/Makefile
+--- vzctl-2.7.0-21-gentoo/src/Makefile 2005-09-23 19:46:37.460922776 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/src/Makefile  2005-09-23 19:46:25.085804080 +0400
+@@ -14,7 +14,7 @@
+       LIBDIR = $(PREFIX)/lib/vzctl
+     CACHEDIR = /vz/template/cache
+    VZCONFDIR = /etc/conf.d
+-  VPSCONFDIR = /etc/sysconfig/vz-scripts
++  VPSCONFDIR = /etc/vz
+  DISTCONFDIR = $(VPSCONFDIR)/dists
+ NETSCRIPTDIR = /etc/sysconfig/network-scripts
+     CRONDDIR = /etc/cron.d
+diff -ur vzctl-2.7.0-21-gentoo/src/vzsplit.c vzctl-2.7.0-21-gentoo_etc_vz/src/vzsplit.c
+--- vzctl-2.7.0-21-gentoo/src/vzsplit.c        2005-09-23 00:42:17.000000000 +0400
++++ vzctl-2.7.0-21-gentoo_etc_vz/src/vzsplit.c 2005-09-23 19:36:41.454529520 +0400
+@@ -27,7 +27,7 @@
+ 
+ #define PROCMEM               "/proc/meminfo"
+ #define PROCTHREADS   "/proc/sys/kernel/threads-max"
+-#define OUTPATH               "/etc/sysconfig/vz-scripts/"
++#define OUTPATH               "/etc/vz/"
+ #define PROCCPU               "/proc/cpuinfo"
+ 
+ #define MAX_SL                3
diff --git a/sys-cluster/vzctl/metadata.xml b/sys-cluster/vzctl/metadata.xml
new file mode 100644 (file)
index 0000000..63d4592
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>vserver</herd>
+</pkgmetadata>
diff --git a/sys-cluster/vzctl/vzctl-2.7.0.21.ebuild b/sys-cluster/vzctl/vzctl-2.7.0.21.ebuild
new file mode 100644 (file)
index 0000000..0aae0ac
--- /dev/null
@@ -0,0 +1,68 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-2.7.0.21.ebuild,v 1.1 2005/09/26 15:32:35 hollow Exp $
+
+inherit eutils toolchain-funcs versionator linux-info
+
+VVER="$(get_version_component_range 1-3 ${PV})"
+VREL="$(get_version_component_range 4 ${PV})"
+MY_PV="${VVER}-${VREL}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="OpenVZ VPS control utility"
+HOMEPAGE="http://openvz.org/"
+SRC_URI="http://download.openvz.org/utils/${PN}/${MY_PV}/src/${MY_P}.tar.bz2"
+
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="~x86"
+
+RDEPEND="app-admin/logrotate
+       app-shells/bash
+       sys-apps/sed
+       sys-apps/ed
+       sys-apps/grep
+       sys-apps/gawk
+       sys-apps/coreutils
+       net-firewall/iptables
+       app-arch/tar
+       sys-fs/vzquota
+       sys-process/procps
+       sys-apps/iproute2"
+
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFIG_CHECK="FAIRSCHED VE VE_CALLS VE_NETDEV VE_IPTABLES"
+
+pkg_setup() {
+       linux-info_pkg_setup
+       check_kernel_built
+}
+
+src_unpack() {
+       unpack ${A} || die
+       cd ${S} || die
+
+       epatch ${FILESDIR}/vzctl-2.7.0-gentoo_conf_d.patch
+       epatch ${FILESDIR}/vzctl-2.7.0-gentoo_etc_vz.patch
+}
+                       
+src_compile() {
+       emake VZKERNEL_HEADERS=${KV_DIR}/include || die "emake failed"
+}
+
+src_install() {
+       make DESTDIR="${D}" VZCONFDIR=/etc/conf.d/ install || die "make install failed"
+
+       # sysconfig is vendor specific
+       rm -rf ${D}/etc/sysconfig/network-scripts
+
+       # Install gentoo specific init script
+       rm -f ${D}/etc/init.d/*
+       newinitd ${FILESDIR}/vz.initd vz
+
+       # Fix permissions on cron.d files
+       chmod 0644 ${D}/etc/cron.d/*
+}