3 # Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 # based on distrib/install-post by Jacques Gelinas
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # Complete the installation of a vserver
21 : ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars}
22 test -e "$UTIL_VSERVER_VARS" || {
23 echo "Can not find util-vserver installation; aborting..."
26 . "$UTIL_VSERVER_VARS"
28 USR_LIB_VSERVER=$PKGLIBDIR
37 echo install-post.sh vserver
41 mkdir $VROOT/dev && chmod 755 $VROOT/dev
43 vserver_mknod $VROOT/dev/null c 1 3 666
44 vserver_mknod $VROOT/dev/zero c 1 5 666
45 vserver_mknod $VROOT/dev/full c 1 7 666
46 vserver_mknod $VROOT/dev/random c 1 8 644
47 vserver_mknod $VROOT/dev/urandom c 1 9 644
48 vserver_mknod $VROOT/dev/tty c 5 0 666
49 vserver_mknod $VROOT/dev/ptmx c 5 2 666
50 test -f /etc/vservers/$1.conf || cp $USR_LIB_VSERVER/sample.conf /etc/vservers/$1.conf
51 test -f /etc/vservers/$1.sh || cp $USR_LIB_VSERVER/sample.sh /etc/vservers/$1.sh
52 echo NETWORKING=yes >$VROOT/etc/sysconfig/network
53 echo HOSTNAME=$1 >>$VROOT/etc/sysconfig/network
55 cd $VROOT/etc/rc.d/init.d || cd $VROOT/etc/init.d
59 *.bak|*~|functions|killall|halt|single)
62 $USR_LIB_VSERVER/capchroot $VROOTDIR/$1 /sbin/chkconfig --level 2345 $serv off
66 rm -f $VROOT/etc/rc.d/rc6.d/S*reboot
68 if [ ! -f $VROOT/etc/fstab ] ; then
69 echo /dev/hdv1 / ext2 defaults 1 1 >$VROOT/etc/fstab
70 echo /dev/hdv1 / ext2 rw 1 1 >$VROOT/etc/mtab
72 cp -a $USR_LIB_VSERVER/vreboot $VROOT/sbin/.
73 ln -sf vreboot $VROOT/sbin/vhalt
74 if [ -x /etc/vservers/install-post.sh ]; then
75 /etc/vservers/install-post.sh $VROOT