#!/bin/sh echo "=====> Cleaning /etc/init on vserver $2 for upstart <===== " # http://linux-vserver.org/Upstart_issues#Running_an_upstart_based_guest ORIG_DIR=`pwd` cd /vservers/$2/etc/init for FILE in dmesg.conf hostname.conf hwclock-save.conf hwclock.conf mountall-net.conf mountall-reboot.conf mountall-shell.conf mountall.conf network-interface.conf networking.conf procps.conf rsyslog-kmsg.conf tty1.conf tty2.conf tty3.conf tty4.conf tty5.conf tty6.conf upstart-udev-bridge.conf console-setup.conf start-ttys.conf tty.conf serial.conf plymouth-shutdown.conf quit-plymouth.conf kexec-disable.conf splash-manager.conf ; do rm -vf $FILE done sed -i 's/^\(console output\)$/#\1/1' * cat > vserver.conf << EOF description "Vserver init" start on startup #console output task pre-start script touch /var/run/utmp chown root:utmp /var/run/utmp chmod 664 /var/run/utmp end script script initctl emit virtual-filesystems --no-wait initctl emit local-filesystems --no-wait initctl emit remote-filesystems --no-wait initctl emit all-swaps --no-wait initctl emit filesystem --no-wait initctl emit mounting --no-wait initctl emit mounted MOUNTPOINT=/dev --no-wait initctl emit mounted MOUNTPOINT=/var/run --no-wait initctl emit mounted MOUNTPOINT=/tmp --no-wait initctl emit net-device-up IFACE=lo --no-wait end script EOF cd $ORIG_DIR