minit4rhl project

Files can be found here.

Some steps like the package-rebuilds and the repository creation which are shown in the examples below could be ommited and/or simplified by doing QA for Fedora bugs #512, #559, #560, #571 and #599.

Sample setups

The sample(s) below are assuming a Red Hat Linux 9 installation with the apt package from the Fedora Linux Project and a vserver-capable kernel.

A simple ftp-vserver

  1. Get and install the vserver userspace-tools with minit-support and minimalized vserver ... build behavior on the host-machine:
    $ wget http://www.tu-chemnitz.de/~ensc/fedora/vserver-0.23-0.fdr.5.src.rpm
    $ rpmbuild --rebuild vserver-0.23-0.fdr.5.src.rpm
    # rpm -Uvh /usr/src/redhat/RPMS/i386/vserver-0.23-0.fdr.5.i386.rpm
    Note: Depending on your system, some paths may differ, and for the second step you will need write-access to the /usr/src/redhat directory.
  2. Build an initial ftp-sample vserver by executing
    # vserver ftp-sample build
    Note: In contrast to the vserver-tool of the original vserver-package, this command will not copy the host-system filetree into the vserver, but creates some directories and inodes only.
  3. Adapt /etc/vserver/ftp-sample.conf to your needs and add the minit keyword to the S_FLAGS. A configfile can look like:
    IPROOT=YOUR IP ADDRESS
    IPROOTDEV=eth0
    S_HOSTNAME=ftp-sample.YOUR DOMAIN
    ONBOOT=yes
    S_DOMAINNAME=
    S_NICE=
    S_FLAGS="lock nproc minit"
    ULIMIT="-H -u 200"
    S_CAPS=""
    AUTO_SHUTDOWN=yes
    RPM_IGNORE_DOC=
    # RPM_INSTALL_OPTIONS="-o RPM::Install-Options::=--promoteepoch"
    Note: there must be used senseful values for IPROOT and S_HOSTNAME.
  4. Install the vftpd-minit package inclusive its requirements on this vserver. When using the vapt-get tool and the vserver-rpm package, this can be done with the following steps:
    1. Build the vserver-rpm package and install the resulting binary:
      $ wget http://www.tu-chemnitz.de/~ensc/vserver/vrpm/vserver-rpm-0.10-1.src.rpm
      $ rpmbuild --rebuild vserver-rpm-0.10-1.src.rpm
      # rpm -Uvh /usr/src/redhat/RPMS/i386/vserver-rpm-0.10-1.i386.rpm
    2. Install vapt-get somewhere into your path also; e.g. with
      $ wget http://www.tu-chemnitz.de/~ensc/vserver/vapt-get
      # install -p -m755 vapt-get /usr/local/sbin/
    3. Fetch the minit-scripts, minit, minit-setup, and minit-tools packages, build and install them in the same manner as above:
      $ wget http://www.tu-chemnitz.de/~ensc/fedora/minit-0.9.1-0.fdr.2.src.rpm \
             http://www.tu-chemnitz.de/~ensc/fedora/minit-scripts-0.4-0.fdr.1.src.rpm \
             http://www.tu-chemnitz.de/~ensc/fedora/minit-setup-0.6-0.fdr.3.src.rpm \
             http://www.tu-chemnitz.de/~ensc/fedora/minit-tools-0.6-0.fdr.1.src.rpm
      $ rpmbuild --rebuild minit-0.9.1-0.fdr.2.src.rpm minit-setup-0.6-0.fdr.3.src.rpm \
             minit-tools-0.6-0.fdr.1.src.rpm
      # rpm -Uvh /usr/src/redhat/RPMS/i386/minit-tools-devel-0.6-0.fdr.1.i386.rpm
      $ rpmbuild --rebuild minit-scripts-0.4-0.fdr.1.src.rpm
    4. Generate a local apt-repository with these packages:
      $ D=/var/data/apt-repo
      $ mkdir -p $D/redhat/{base,RPMS.minit,SRPMS.minit} && cd $D/redhat
      $ echo -e 'Archive: local\nComponent: minit\nVersion: 9' >base/release.minit
      $ echo -e 'Origin: local\nLabel=minit repo\nArchitecture: i386' >>base/release.minit
      $ cp -a /usr/src/redhat/RPMS/*/minit-* RPMS.minit
      $ genbasedir --flat --bloat `pwd` minit
    5. Initialize the apt/rpm environment in the vserver and add the just created repository to the source-list:
      # D=/var/data/apt-repo
      # vdir=/vservers/ftp-sample
      # mkdir -p $vdir/etc/{rpm,apt} $vdir/var/cache/apt
      # echo -e '%_install_langs C\n%_netsharedpath /dev' >$vdir/etc/rpm/macros
      # cp -a /etc/apt/{sources,vendors}.list* $vdir/etc/apt
      # rm -f $vdir/etc/apt/sources.list.d/macromedia.list
      # echo "rpm file:$D redhat minit" >>$vdir/etc/apt/sources.list"
      # echo -e 'Essential:\n    vsftpd-minit' >$vdir/etc/apt/rpmpriorities
      # perl -pi -e 's!(GPG-Check "true")!// \1!' /etc/apt/apt.conf
      Note: The last step disables GPG signature checking since our repository/our packages are not signed. In production-environments, it is strictly advised to use signed repositories and to keep this setting enabled.
    6. Now, the vserver can be bootstrapped by:
      # vapt-get ftp-sample -- update
      # vapt-get ftp-sample -- install filesystem -y
      # vapt-get ftp-sample -- install coreutils -y
      # vapt-get ftp-sample -- dist-upgrade -y
      Note: the middle two install steps are required because of packaging-bugs in some RHL9 packages (insufficient pre/post requirements).
  5. Now, the basic vserver exists and the minit system must be set up:
    # vserver ftp-sample exec minit-svc add stop/VSERVER ctrlaltdel/
    # vserver ftp-sample exec minit-svc add services/vsftpd services/
    The first command adds the VSERVER stop-method as the last command for ctrlaltdel/ (shutdown), and the second one adds 'vsftpd' as a service which will be executed. There are existing graphical representations of the startup and shutdown flow also.
  6. The final setup-step is to stop/start the vserver and to test it with restart:
    # vserver ftp-sample stop
    # vserver ftp-sample start
    # vserver ftp-sample restart
    On recent hardware, the restart command should not take more than 7 seconds .

Enrico Scholz
Last modified: Wed Aug 20 00:48:40 CEST 2003
Valid XHTML 1.0! Valid CSS!