diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-09 23:03:37 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-09 23:03:37 +0000 |
commit | a08e3948543f888c02971e8916fcb56e3bec8160 (patch) | |
tree | ad43b5fc7fe5ebc2885a4d576525d6896200ba3c /templates | |
parent | 3e9ca41594092f8296dd5554058624b62132085c (diff) | |
download | simplepkg-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')
-rw-r--r-- | templates/vserver-legacy/vserver-legacy.s/vserver-legacy.sh | 11 | ||||
-rw-r--r-- | templates/vserver/vserver.s/vserver.sh | 10 |
2 files changed, 14 insertions, 7 deletions
diff --git a/templates/vserver-legacy/vserver-legacy.s/vserver-legacy.sh b/templates/vserver-legacy/vserver-legacy.s/vserver-legacy.sh index f243ea0..4ce8a4b 100644 --- a/templates/vserver-legacy/vserver-legacy.s/vserver-legacy.sh +++ b/templates/vserver-legacy/vserver-legacy.s/vserver-legacy.sh @@ -3,9 +3,10 @@ # legacy vserver template # -DEVICES="/etc/simplepkg/vserver-legacy.s/devices.tar.gz" -GPGKEY="/etc/simplepkg/vserver-legacy.s/GPG-KEY" -SKEL="/etc/simplepkg/vserver-legacy.s/skel.conf" +BASE="/etc/simplepkg/templates/vserver-legacy/vserver-legacy.s/" +DEVICES="$BASE/devices.tar.gz" +GPGKEY="$BASE/GPG-KEY" +SKEL="$BASE/skel.conf" if [ -z "$2" ]; then echo "usage: `basename $0` <jail-root> <jail-name>" @@ -30,7 +31,8 @@ else fi if [ -f "$SKEL" ]; then - echo "creating /etc/vservers/$2.conf" + echo "creating /etc/vservers/$2.conf" + mkdir -p /etc/vservers cp $SKEL /etc/vservers/$2.conf else echo error: config file template $SKEL not found @@ -42,7 +44,6 @@ if [ -f "$GPGKEY" ]; then gpg --homedir $1/$2/root/.gnupg --import $GPGKEY fi -# todo: add rebootmgr echo "done; now edit /etc/vservers/$2.conf" echo "then, set all desired iptables rules and start $server vserver" echo "dont forget to change root's password with the command "vserver $2 exec passwd"" 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 |