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 USR_LIB_VSERVER=$(dirname $0)
29 echo install-post.sh vserver
33 mkdir $VROOT/dev && chmod 755 $VROOT/dev
35 vserver_mknod $VROOT/dev/null c 1 3 666
36 vserver_mknod $VROOT/dev/zero c 1 5 666
37 vserver_mknod $VROOT/dev/full c 1 7 666
38 vserver_mknod $VROOT/dev/random c 1 8 644
39 vserver_mknod $VROOT/dev/urandom c 1 9 644
40 vserver_mknod $VROOT/dev/tty c 5 0 666
41 vserver_mknod $VROOT/dev/ptmx c 5 2 666
42 test -f /etc/vservers/$1.conf || cp $USR_LIB_VSERVER/sample.conf /etc/vservers/$1.conf
43 test -f /etc/vservers/$1.sh || cp $USR_LIB_VSERVER/sample.sh /etc/vservers/$1.sh
44 echo NETWORKING=yes >$VROOT/etc/sysconfig/network
45 echo HOSTNAME=$1 >>$VROOT/etc/sysconfig/network
47 cd $VROOT/etc/rc.d/init.d || cd $VROOT/etc/init.d
51 *.bak|*~|functions|killall|halt|single)
54 $USR_LIB_VSERVER/capchroot /vservers/$1 /sbin/chkconfig --level 2345 $serv off
58 rm -f $VROOT/etc/rc.d/rc6.d/S*reboot
60 if [ ! -f $VROOT/etc/fstab ] ; then
61 echo /dev/hdv1 / ext2 defaults 1 1 >$VROOT/etc/fstab
62 echo /dev/hdv1 / ext2 rw 1 1 >$VROOT/etc/mtab
64 cp -a $USR_LIB_VSERVER/vreboot $VROOT/sbin/.
65 ln -sf vreboot $VROOT/sbin/vhalt
66 if [ -x /etc/vservers/install-post.sh ]; then
67 /etc/vservers/install-post.sh $VROOT