----------------------------------------------- Step-by-step install of a "runit"-based vserver ----------------------------------------------- (1) [On the host] Create the vserver # vserver phony build -m debootstrap \ --hostname phony.harfang.homelinux.org \ --netdev dummy0 --interface 192.168.83.100/24 \ --context 100 --initstyle plain -- -d sarge -- --include=less,ssh Start and enter the vserver # vserver phony start # vserver phony enter (2) [Inside "phony"] Start the ssh daemon and set the root password # /etc/init.d/ssh start # passwd (3) In "/etc/inittab", comment out the lines invoking "getty": # nano /etc/inittab (4) # exit (5) [On the host] Update "/etc/hosts" 192.168.83.100 phony.harfang.homelinux.org phony Copy "/etc/apt/sources.list" over to the vserver directory # cp /etc/apt/sources.list /var/lib/vservers/phony/etc/apt (6) # ssh root@phony [Inside "phony"] (7) Update the packages list and remove useless packages # apt-get update # REMOVE_PACKAGES=" pciutils fdutils makedev base-config klogd sysklogd logrotate cron at ppp pppconfig pppoe pppoeconf console-common console-data console-tools telnet netkit-inetd netbase tcpd ifupdown wget ipchains dhcp-client exim4 exim4-base exim4-config exim4-daemon-light cpio nvi " # apt-get --purge remove $REMOVE_PACKAGES (8) Install runit and set up ssh as a supervised service # apt-get install runit Setting up ssh: 1. File "/etc/runit/sshd/run" #!/bin/sh exec 2>&1 exec sshd -D -e 2. File "/etc/runit/sshd/log/run": #!/bin/sh exec svlogd /var/log/service/sshd 3. Logging directory: # mkdir /var/log/service/sshd 4. Start the service # ln -s /etc/runit/sshd /var/service 5. Stop the daemon started through SysV scheme: # /etc/init.d/ssh stop Replace "/sbin/init" # apt-get install runit-run Notes: 1. Executable bit (+x) not set for stages "1", "2" and "3". # chmod a+x /etc/runit/[123] 2. Hardware-related one-time system tasks (in stage "1") should be disabled. Comment out the line "/etc/init.d/rcS" 3. "getty" services shouldn't be enabled # rm /var/service/getty* 4. Hardware-related shutdown tasks (in stage "3") should be disabled. Comment out the line "/etc/init.d/rc $LAST"