[RFC] allow specifying startup event

Serge E. Hallyn serge.hallyn at canonical.com
Fri Jan 14 18:24:14 UTC 2011

Quoting Scott James Remnant (scott at netsplit.com):
> On Fri, Jan 14, 2011 at 5:48 PM, Serge E. Hallyn
> <serge.hallyn at canonical.com> wrote:
> > Quoting Scott James Remnant (scott at netsplit.com):
> >> There should be no need to alter the existing code to do what you
> >> want, and changing things like the startup event means that any job
> >> specifying:
> >>
> >>     start on startup and...
> >>
> >> would now no longer work!
> >
> > The lxc.conf which starts on lxc emits startup after doing some
> > pre-config, so these should keep working.  (And my laptop with
> > these patches has been booting fine)
> >
> What kind of things do you do here?

In particular what I did was:

	initctl emit -n startup BUILTIN_FSTAB=/lib/init/fstab.lxc || true

so that mountall would get the BUILTIN_FSTAB environment variable
through the startup event.

But, now that I can use 'env' to get the init parent environment, I
don't need that.

> (Johan's proposal was that if startup was replaced by a system event,
> you could do "starting system" instead of "started system")

I just saw 'starting' in Clint's 'best practices' RFC, and this lets
me avoid any patches to mountall at all, awesome!

> > when upstart was started as:
> >
> >        10991 execve("/sbin/init", ["/sbin/init", "container=lxc", "builtinfstab=/lib/init/fstab.lxc"], [/* 27 vars */] <unfinished ...>
> >
> This isn't how the kernel starts init when it has these kinds of
> things on its command-line, it places container=lxc and
> builtinfstab=/lib/init/fstab.lxc into init's *environment* not
> arguments.

Ah, I see.  (Of course I don't have a kernel :)  Boot succeeded when
I did

	export container=lxc
	export builtinfstab=/lib/init/fstab.lxc
	lxc-start -n natty2

Looks like I can do what I need with no changes at all to upstart or
mountall.  Thanks!


More information about the upstart-devel mailing list