<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://linux-vserver.at/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://linux-vserver.at/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Faxioman</id>
		<title>Linux-VServer - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://linux-vserver.at/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Faxioman"/>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/Special:Contributions/Faxioman"/>
		<updated>2026-04-09T15:44:27Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://linux-vserver.at/Upstart_issues</id>
		<title>Upstart issues</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/Upstart_issues"/>
				<updated>2010-10-22T13:18:26Z</updated>
		
		<summary type="html">&lt;p&gt;Faxioman: /* Running Ubuntu Lucid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Running Ubuntu Lucid ==&lt;br /&gt;
&lt;br /&gt;
There's a inipost-file ( http://static.thedudes.org/initpost ) that can be used when creating hosts, so there's no need for manual tweaking. &lt;br /&gt;
Put it in &amp;lt;pre&amp;gt;/usr/lib/util-vserver/distributions/lucid&amp;lt;/pre&amp;gt; Install the vserver with --initstyle plain. You still need to look over services when installing since we're tweaking Upstarts normal emits.&lt;br /&gt;
&lt;br /&gt;
!! Note !! The inipost-file is missing. You can temporarely download it from: http://dl.dropbox.com/u/1171189/initpost&lt;br /&gt;
&lt;br /&gt;
You can also have a look at http://wiki.raceme.org/dokuwiki/tof:computer:vserver:upstart_ubuntu_lucid for a manual procedure.&lt;br /&gt;
&lt;br /&gt;
== Running an upstart based guest ==&lt;br /&gt;
&lt;br /&gt;
currently upstart based guests need some manual tweaking to make them work inside a vserver guest.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the host ===&lt;br /&gt;
First of all you need to set the init style of your vserver to plain&lt;br /&gt;
 # echo plain &amp;gt; /etc/vservers/&amp;lt;vservername&amp;gt;/apps/init/style&lt;br /&gt;
&lt;br /&gt;
Or use '--initstyle plain' when creating the host.&lt;br /&gt;
&lt;br /&gt;
I'd also strongly recommend to mount &amp;lt;code&amp;gt;/var/run&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/var/lock&amp;lt;/code&amp;gt; of the guest as tmpfs. So add the following lines to&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/vservers/&amp;lt;vservername&amp;gt;/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
 none    /var/run        tmpfs   size=16m,nosuid,mode=0755       0 0&lt;br /&gt;
 none    /var/lock       tmpfs   size=16m,noexec,nosuid,nodev    0 0&lt;br /&gt;
&lt;br /&gt;
=== Remove low level services inside the guest ===&lt;br /&gt;
Then you need to get rid of anything in &amp;lt;code&amp;gt;/etc/init/&amp;lt;/code&amp;gt; that tries to fiddle with your Server's Hardware or other low-level Stuff that's already handled by your host's kernel/system. Having one such scriptlet still enabled might cause the whole upstart system to fail (like not beeing able to open &amp;lt;code&amp;gt;/dev/console&amp;lt;/code&amp;gt; or failing to start the udev system).&lt;br /&gt;
Just remove these scriptlets, move them out of the way or rename them to something not ending in &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt;. Be aware that upstart also parses subfolders of &amp;lt;code&amp;gt;/etc/init/&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
This is what I deleted on a basic Ubuntu 9.10 guest:&lt;br /&gt;
 dmesg.conf&lt;br /&gt;
 hostname.conf&lt;br /&gt;
 hwclock-save.conf&lt;br /&gt;
 hwclock.conf&lt;br /&gt;
 mountall-net.conf&lt;br /&gt;
 mountall-reboot.conf&lt;br /&gt;
 mountall-shell.conf&lt;br /&gt;
 mountall.conf&lt;br /&gt;
 network-interface.conf&lt;br /&gt;
 networking.conf&lt;br /&gt;
 procps.conf&lt;br /&gt;
 rsyslog-kmsg.conf&lt;br /&gt;
 tty1.conf&lt;br /&gt;
 tty2.conf&lt;br /&gt;
 tty3.conf&lt;br /&gt;
 tty4.conf&lt;br /&gt;
 tty5.conf&lt;br /&gt;
 tty6.conf&lt;br /&gt;
 upstart-udev-bridge.conf&lt;br /&gt;
&lt;br /&gt;
In Ubuntu 10.04 you also want to remove:&lt;br /&gt;
 console-setup.conf &lt;br /&gt;
&lt;br /&gt;
=== Services you want to look over ===&lt;br /&gt;
There are files in the /etc/init dir that you want to check the startup line of.&lt;br /&gt;
It could be waiting for something that will never happend since it is in a VServer and thus never start.&lt;br /&gt;
&lt;br /&gt;
for example mysql.conf needs a 'net-device-up'-emit also.&lt;br /&gt;
by running&lt;br /&gt;
 vserver &amp;lt;name&amp;gt; exec initctl emit net-device-up&lt;br /&gt;
&lt;br /&gt;
it will come up like a charm.&lt;br /&gt;
Either put this in vserver.conf or remove in from mysql.conf.&lt;br /&gt;
&lt;br /&gt;
Jobs that doesn't start from scratch:&lt;br /&gt;
 mysql-server-5.1 (mysql.conf)&lt;br /&gt;
&lt;br /&gt;
=== Fake low level events inside the guest ===&lt;br /&gt;
Finally you need to fake emit the events that some of these scripts would do during regular boot. Probably the cleanest approach is to add a scriptlet &amp;lt;code&amp;gt;vserver.conf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/init/&amp;lt;/code&amp;gt; with this content:&lt;br /&gt;
 start on startup&lt;br /&gt;
 script&lt;br /&gt;
        touch /var/run/utmp&lt;br /&gt;
        chown root:utmp /var/run/utmp&lt;br /&gt;
        chmod 664 /var/run/utmp&lt;br /&gt;
        initctl emit virtual-filesystems&lt;br /&gt;
        initctl emit local-filesystems&lt;br /&gt;
        initctl emit remote-filesystems&lt;br /&gt;
        initctl emit filesystem&lt;br /&gt;
 end script&lt;br /&gt;
&lt;br /&gt;
The utmp stuff is needed if you mount &amp;lt;code&amp;gt;/var/run&amp;lt;/code&amp;gt; as tmpfs and you don't create utmp anywhere else.&lt;br /&gt;
&lt;br /&gt;
=== Remove console outputs ===&lt;br /&gt;
&lt;br /&gt;
If your VServer hangs on the command&lt;br /&gt;
 vserver &amp;lt;name&amp;gt; stop&lt;br /&gt;
&lt;br /&gt;
and puts out&lt;br /&gt;
 A timeout occured while waiting for the vserver to finish and it will&lt;br /&gt;
 be killed by sending a SIGKILL signal. The following process list&lt;br /&gt;
 might be useful for finding out the reason of this behavior:&lt;br /&gt;
 &lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;pid&amp;gt; &amp;lt;context&amp;gt; &amp;lt;name&amp;gt;           ?        Ss     0:00 /sbin/init&lt;br /&gt;
 &amp;lt;pid&amp;gt; &amp;lt;context&amp;gt; &amp;lt;name&amp;gt;           ?        Ss     0:00 /sbin/init&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
you should run&lt;br /&gt;
 sed -i 's/^\(console output\)$/#\1/1' /etc/vservers/$name/vdir/etc/init/*&lt;br /&gt;
&lt;br /&gt;
which will disable all lines with 'console output', and Upstart won't try output to it. Which is a good thing since it doesn't exist.&lt;br /&gt;
&lt;br /&gt;
=== Adapt /etc/init/rc-sysinit.conf inside the guest ===&lt;br /&gt;
&lt;br /&gt;
This depends on net-device-up IFACE=lo, remove this from the start line so that it reads:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;start on filesystem&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This scriptlet tries to parse &amp;lt;code&amp;gt;/proc/cmdline&amp;lt;/code&amp;gt; which will not work and probably isn't needed inside a vserver.&amp;lt;br/&amp;gt;&lt;br /&gt;
Simply comment out or delete the whole &amp;lt;code&amp;gt;for ARG in $(cat /proc/cmdline) do...done&amp;lt;/code&amp;gt; loop.&lt;br /&gt;
&lt;br /&gt;
=== Notes for debugging ===&lt;br /&gt;
&lt;br /&gt;
First you need to run Upstart with the --debug flag,&lt;br /&gt;
one way of doing it is inserting&lt;br /&gt;
 &amp;quot;--debug&amp;quot;&lt;br /&gt;
 in INITCMD_START under the xplain-clause inside /usr/lib/util-vserver/vserver.functions (row 316 here)&lt;br /&gt;
 so it reads INITCMD_START=( /sbin/init &amp;quot;--debug&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Second you should enable console output in the rc-files inside /etc/init, if you had commented them out before you could do&lt;br /&gt;
 sed -i 's/#^\(console output\)$/\1/1' /etc/vservers/$name/vdir/etc/init/*&lt;br /&gt;
&lt;br /&gt;
Third you need a device to act as console, I used tty0.&lt;br /&gt;
 cp -a /dev/tty0 /etc/vservers/$name/vdir/dev/console&lt;br /&gt;
&lt;br /&gt;
If you do things at a console of the machine it will now print out detailed information. More on how to debug a Upstart job you'll find on http://upstart.ubuntu.com/wiki/Debugging.&lt;br /&gt;
Notice that if one fails they all fail.&lt;br /&gt;
&lt;br /&gt;
=== Notes for older kernels ===&lt;br /&gt;
If you encounter upstart errors like this:&lt;br /&gt;
&lt;br /&gt;
 $ vserver foo start&lt;br /&gt;
 init: missing runlevel&lt;br /&gt;
 Try `init --help' for more information.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 $ vserver foo start&lt;br /&gt;
 telinit: Failed to connect to socket /com/ubuntu/upstart: Connection refused&lt;br /&gt;
&lt;br /&gt;
then you're probably running the current stable version &amp;lt;code&amp;gt;2.6.22.19-vs2.2.0.7&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Upstart's &amp;lt;code&amp;gt;/sbin/init&amp;lt;/code&amp;gt; implementation requires to be PID 1. It is linked against NPTL (in contrast to sysvinit), which has a bug in it's caching &amp;lt;code&amp;gt;getpid(2)&amp;lt;/code&amp;gt; wrapper. With this kernel version &amp;lt;code&amp;gt;getpid(2)&amp;lt;/code&amp;gt; returns the cached PID to init, resulting in init replacing itself with telinit. You can fix this by upgrading to a &amp;lt;code&amp;gt;2.6.26+&amp;lt;/code&amp;gt; kernel and a newer vserver patch, or by patching upstart:&lt;br /&gt;
&lt;br /&gt;
 diff --git a/init/main.c b/init/main.c&lt;br /&gt;
 index bfcd528..c6c9304 100644&lt;br /&gt;
 --- a/init/main.c&lt;br /&gt;
 +++ b/init/main.c&lt;br /&gt;
 @@ -37,6 +37,7 @@&lt;br /&gt;
  #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
  #include &amp;lt;syslog.h&amp;gt;&lt;br /&gt;
  #include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
 +#include &amp;lt;syscall.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  #include &amp;lt;linux/kd.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 @@ -131,7 +132,7 @@ main (int   argc,&lt;br /&gt;
  	}&lt;br /&gt;
  &lt;br /&gt;
  	/* Check we're process #1 */&lt;br /&gt;
 -	if (getpid () &amp;gt; 1) {&lt;br /&gt;
 +	if (syscall(SYS_getpid) &amp;gt; 1) {&lt;br /&gt;
  		execv (TELINIT, argv);&lt;br /&gt;
  		/* Ignore failure, probably just that telinit doesn't exist */&lt;br /&gt;
&lt;br /&gt;
For more information see the man pages of &amp;lt;code&amp;gt;getpid(2)&amp;lt;/code&amp;gt; (NOTES) and &amp;lt;code&amp;gt;clone(2)&amp;lt;/code&amp;gt; (BUGS).&lt;br /&gt;
&lt;br /&gt;
=== Init procedure doesn't complete ===&lt;br /&gt;
==== SSH ====&lt;br /&gt;
If you've completed all above steps and some init scripts doesn't get invoked at all (most notably old SYSV init scripts) you might have encountered same error that I did.&lt;br /&gt;
In Lucid guest I had to comment out following line in /etc/init/ssh.conf:&lt;br /&gt;
  # replaces SSHD_OOM_ADJUST in /etc/default/ssh&lt;br /&gt;
  oom never&lt;br /&gt;
to&lt;br /&gt;
  # replaces SSHD_OOM_ADJUST in /etc/default/ssh&lt;br /&gt;
  #oom never&lt;br /&gt;
&lt;br /&gt;
After commenting out this line initialization completed successfully.&lt;br /&gt;
&lt;br /&gt;
==== D-BUS ====&lt;br /&gt;
When creating guest as chroot some packages you might expect are missing. One of these is D-BUS. Strangely enough the /etc/init/dbus.conf gets installed which prevents Upstart to finish its starting sequence.&lt;br /&gt;
&lt;br /&gt;
Solution: install dbus package&lt;br /&gt;
&lt;br /&gt;
    sudo aptitude install dbus&lt;/div&gt;</summary>
		<author><name>Faxioman</name></author>	</entry>

	</feed>