|
Table des matières
Fix for running Ubuntu Lucid in vserverThis tweak is inspired by http://linux-vserver.org/Upstart_issues. Choose plain init styleYou can do that while building the vserver: # vserver <vservername> build --initstyle plain ... or afterward: # echo plain > /etc/vservers/<vservername>/apps/init/style Add tmpfs for varlock and varrun# echo 'none /var/run tmpfs size=16m,nosuid,mode=0755 0 0' >>/etc/vservers/<vservername>/fstab # echo 'none /var/lock tmpfs size=16m,noexec,nosuid,nodev 0 0' >>/etc/vservers/<vservername>/fstab Remove incompatible upstart services
# mkdir /etc/vservers/<vservername>/vdir/root/init.disabled
# for srv in console-setup dmesg failsafe-x hostname hwclock-save hwclock module-init-tools \
mountall-net mountall-reboot mountall-shell mountall network-interface network-interface-security networking \
plymouth-log plymouth-splash plymouth-stop plymouth procps rcS rsyslog-kmsg tty1 tty2 tty3 tty4 tty5 tty6 \
upstart-udev-bridge ureadahead-other ureadahead; do mv /etc/vservers/<vservername>/vdir/etc/init/${srv}.conf \
/etc/vservers/<vservername>/vdir/root/init.disabled/; done
Be carefull to keep the 20:00 <@Bertl> util-vserver does not execute stuff inside the guest, it simply sends a signal to init (inside the guest) 20:01 <@Bertl> (the singnal is SIGINT, and this equals to the CTRL-ALT-DEL action) Add vserver init task
Create the file
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
Tweak sysinit configuration
In start on filesystem and net-device-up IFACE=lo by: start on filesystem Tweak rsyslog configuration
In ################# #### MODULES #### ################# $ModLoad imuxsock # provides support for local system logging #$ModLoad imklog # provides kernel logging support (previously done by rklogd) #$ModLoad immark # provides --MARK-- message capability #$KLogPath /proc/kmsg
In # The named pipe /dev/xconsole is for the `xconsole' utility. To use it, # you must invoke `xconsole' with the `-file' option: # # $ xconsole -file /dev/xconsole [...] # # NOTE: adjust the list below, or you'll go crazy if you have a reasonably # busy site.. # #daemon.*;mail.*;\ # news.err;\ # *.=debug;*.=info;\ # *.=notice;*.=warn |/dev/xconsole Tweak ssh configuration
In # replaces SSHD_OOM_ADJUST in /etc/default/ssh #oom never Create the console device
Missing of
19:57 <@Bertl> well, regarding console: you probably don't want 'the console' created inside a guest, because that means that
upstart (from the guest) will write on your host console (and can read stuff from there too)
19:58 <@Bertl> what you want is to put a tty or pts there instead of the console, or if you like to see the output on the
current tty just tty
I use # mknod --mode=600 /etc/vservers/<vservername>/vdir/dev/console c 5 0
If you want to troubleshot from outside the vserver you can use for example # mknod --mode=600 /etc/vservers/<vservername>/vdir/dev/console c 4 8 Install dbusDbus seems to be required by some init script as read on a mailing-list (cannot get back the reference); so install it in the vserver: # aptitude install dbus |