aboutsummaryrefslogtreecommitdiff
path: root/templates/vserver
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-09 23:03:37 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-09 23:03:37 +0000
commita08e3948543f888c02971e8916fcb56e3bec8160 (patch)
treead43b5fc7fe5ebc2885a4d576525d6896200ba3c /templates/vserver
parent3e9ca41594092f8296dd5554058624b62132085c (diff)
downloadsimplepkg-a08e3948543f888c02971e8916fcb56e3bec8160.tar.gz
simplepkg-a08e3948543f888c02971e8916fcb56e3bec8160.tar.bz2
vservers post-install scripts fixed
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@178 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'templates/vserver')
-rw-r--r--templates/vserver/vserver.s/vserver.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/vserver/vserver.s/vserver.sh b/templates/vserver/vserver.s/vserver.sh
index b381092..e9d68a9 100644
--- a/templates/vserver/vserver.s/vserver.sh
+++ b/templates/vserver/vserver.s/vserver.sh
@@ -3,8 +3,9 @@
# vserver template script
#
-DEVICES="/etc/simplepkg/vserver.s/devices.tar.gz"
-GPGKEY="/etc/simplepkg/vserver.s/GPG-KEY"
+BASE="/etc/simplepkg/templates/vserver/vserver.s"
+DEVICES="$BASE/devices.tar.gz"
+GPGKEY="$BASE/GPG-KEY"
if [ -z "$2" ]; then
echo "usage: `basename $0` <jail-root> <jail-name>"
@@ -17,8 +18,13 @@ fi
echo "creating /etc/vservers/$2..."
mv $1/$2 $1/$2.old
vserver $2 build -m skeleton --force &> /dev/null
+result="$?"
rm -rf $1/$2 && mv $1/$2.old $1/$2
+if [ "$result" != "0" ]; then
+ mkdir -p /etc/vservers/$2/apps/init
+fi
+
echo sysv > /etc/vservers/$2/apps/init/style
echo 3 > /etc/vservers/$2/apps/init/runlevel.start
echo 6 > /etc/vservers/$2/apps/init/runlevel.stop