Subject: chbind the init process of the host (/sbin/init)
From: Manfred Heubach <entwicklung@heubach-edv.de>
Date: Tue, 02 Sep 2008 00:31:44 +0200

Hello,

I'm experimenting with chbind in order to force the init process
(/sbin/init) into a network context with 2 IPs (localhost and a single
private IP).

I call a script at systemboot called /sbin/vinit (via init=/sbin/vinit)

  #!/bin/sh
  exec /usr/sbin/chbind --nid 2 --ip 192.168.2.24 \
  --ip 127.0.0.1 -- /sbin/init $@

When using --nid 1 the script is working but the binding to the
addresses doesn't work. The processes bind to any available IP.

When using --nid 2 the init process stops with the line telling me about
it's usage (like when you give the wrong number of arguments) and I am
ending up with a kernel panic.

Is it actually possible to use chbind on the init process?
Otherwise I could build wrappers for my init scripts - I used them with
earlier versions - but it's always been a bit improvised.

To have the complete root server bound to a network context and only
bound to localhost and one ip address would be quite handy.

Any ideas?

The output of vserver-info is below.

Best regards
Manfred

---------------------------
Versions:
                   Kernel: 2.6.26-1-vserver-686
                   VS-API: 0x00020303
             util-vserver: 0.30.215; Jun  1 2008, 21:56:10

Features:
                       CC: gcc, gcc (GCC) 4.1.2 20061115 (prerelease)
(Debian 4.                                              1.1-21)
                      CXX: g++, g++ (GCC) 4.1.2 20061115 (prerelease)
(Debian 4.                                              1.1-21)
                 CPPFLAGS: ''
                   CFLAGS: '-Wall -g  -O2 -std=c99 -Wall -pedantic -W
-funit-at-                                              a-time'
                 CXXFLAGS: '-g -O2 -ansi -Wall -pedantic -W
-fmessage-length=0 -                                             
funit-at-a-time'
               build/host: i486-pc-linux-gnu/i486-pc-linux-gnu
             Use dietlibc: yes
       Build C++ programs: yes
       Build C99 programs: yes
           Available APIs: v13,net,v21,v22,v23,netv2
            ext2fs Source: e2fsprogs
    syscall(2) invocation: alternative
      vserver(2) syscall#: 273/glibc
               crypto api: beecrypt

Paths:
                   prefix: /usr
        sysconf-Directory: /etc
            cfg-Directory: /etc/vservers
         initrd-Directory: $(sysconfdir)/init.d
       pkgstate-Directory: /var/run/vservers
          vserver-Rootdir: /var/lib/vservers