/srv/irclogs.ubuntu.com/2010/04/22/#upstart.txt

markl_how do i launch upstart?  do i need to tell the kernel to run upstart instead of init?18:24
markl_trying to make openvz play nice with upstart.  i am ending up with a run level of UNKNOWN because there is no inittab on this ubuntu 10.04 vm18:24
markl_ah ok upstart provides /sbin/init.  ok now i am really sad18:27
wasabi_why sad?18:30
markl_because it is ending up at runlevel unknown and i'm not sure what to check next18:30
markl_but at least i get plymouthd :)18:31
markl_w00t18:31
markl_is there a way to get logging out of upstart's init?18:31
markl_since it isn't launching syslog18:31
markl_init 2 seems to at least do something18:36
sadmacmarkl_: you could go into /etc/init.d/rc and set a default runlevel18:37
sadmacmarkl_: normally that file gets it out of inittab18:37
sadmacmarkl_: but ultimately this is an ubuntu question not an upstart question18:37
markl_sadmac: yeah this problem will overlap 3 different projects, upstart, ubuntu, openvz.  fun stuff!19:35
markl_sadmac: is there a good faq that covers this kind of thing?19:35
sadmacmarkl_: not exactly. there's manpages etc. There's more documentation than it seems, but its not terribly easy to index a lot of the time.19:36
sadmacmarkl_: mostly the manpages though.19:36
markl_my main question is why rc-sysinit.conf isn't setting it19:36
markl_isn't that the correct place to set the default runlevel?19:37
sadmacmarkl_: thats an ubuntu decision19:37
markl_ok let's pretend as a mental exercise that i'm creating my own distro and i want to use upstart; what would the best way be to set it?19:37
sadmacmarkl_: that begs the question: do you even want to have runlevels?19:38
markl_for bootup19:38
markl_yes i would prefer them19:38
markl_it was my understanding that the kernel runs init, which will start with rc-sysinint.conf19:39
markl_kind of like how the old init started with inittab19:39
sadmacmarkl_: runlevels are the way sysv does it. upstart doesn't have them "by default." You can use specific configuration and some brute force to *simulate* them, and upstart ships some tools that will deal with utmp and stuff like that to make it easier, but they aren't stock and the init daemon itself doesn't understand them.19:39
markl_is this what ubuntu does?19:40
sadmacmarkl_: yep. Fedora does it too, but the implementations are slightly different.19:40
markl_of course :)19:40
JanCI suppose other upstart-users like android probably don't use runlevels19:41
sadmacI'd have to look but I'd bet not19:41
sadmacmarkl_: so when upstart starts, it emits the "startup" event, thus triggering anything that has "start on startup" in its conf file.19:42
markl_this is specifically an ubuntu problem; it runs init and starts up but without a runlevel.  ideally it would be cool if init had its own log file or something19:42
sadmacmarkl_: rc-sysinit.conf would be one of those I'd imagine19:42
markl_so if my event.d directory is empty, is that a bad sign?19:42
sadmacmarkl_: it'll log to syslog, or console if that's not around.19:42
markl_no console19:42
sadmacmarkl_: ...depends on the version of upstart. newere upstarts use /etc/init.d19:42
sadmac(0.6 and later)19:42
markl_0.6.5-419:43
sadmacyeah, then I'm surprised you have an event.d19:43
markl_ok maybe the page i found with google was outdated19:43
sadmacalmost certainly19:43
markl_well it includes a script to convert inittab to upstart19:43
sadmacupstart doesn't have any support for inittab, but most configurations that emulate sysvinit will parse bits of inittab for compatibility stuff. just the default runlevel in fedora's case19:44
markl_ok thanks, this is very helpful19:44
JanCnewer versiosn use /etc/init/ (not init.d !)19:45
sadmacthen rc-sysinit.conf or rc.conf or whatever the job is that does that parsing on ubuntu sets the runlevel and runs /etc/rc (which is the same thing it was in sysvinit. just a bash script for rulevel transitioning)19:45
sadmacJanC: right. my fault.19:45
sadmacand that's how most distros build their sysv layer.19:46
markl_i have both /etc/init and /etc/init.d.19:46
sadmacmarkl_: yeah, init.d is something else :)19:47
sadmacinit.d contains all the sysvinit scripts19:47
JanCinit.d is for sysvinit scripts that get run by the sysvinit compatibility stuff19:47
sadmac(so not really an upstart thing per se. sysvinit holdover)19:47
markl_ok cool, thanks for being so tolerant of 100% total n00b questions :)19:47
JanCmarkl_: you might want to read "man 5 init"19:48
markl_hmm, so rc-sysinit isn't a script as such, is it?19:50
markl_if i just remove /dev/console, will it create a log file for me?19:50
sadmacmarkl_: no19:50
sadmacmarkl_: advise serial console19:50
markl_no serial ports19:50
sadmacmarkl_: start syslog earlier then19:51
markl_this is a vm, there is no console at all.  i need a way to write to a file to see why it is ignoring rc-sysinit.conf19:51
JanCyou can get a serial console over USB too of course19:51
* sadmac 's virtual machines all have consoles...19:51
sadmacserial or video...19:51
JanC(USB is a serial port)19:51
JanCopenvz doesn't use a virtual machine AFAIK, but uses some container-like technology?19:52
JanCthey probably implemented something similar though19:53
markl_yes it basically starts init in a chroot19:53
markl_but with lots of fun kernel mods to control memory etc better19:53
markl_and the vm's typically run without getty or any sort of console19:54
markl_kind of like driving a stick whereas the other vm's are an automatic19:54
JanCmarkl_: AFAIK something similar ('lc' or "linux containers") is being implemented in the mainline kernel nowadays19:55
markl_yeah, the main gripe with VZ is that their kernel patch is gigantic with no hope of linus accepting it all19:56
markl_so they are moving things into the main kernel as time goes on, which lxc is trying to use19:56
JanCthe LC people did cut up their patches in small chunks for linus to approve one by one  ;)19:57
markl_yep, smart move19:57
JanCor lxc19:57
markl_i'm glad that parallels is getting openvz out for 2.6.32 (rhel6, ubuntu 10.04, debian squeeze)19:57
markl_this may be silly but i'm trying to create a 10.04 template so i can get the kernel patch to work on ubuntu's lucid kernel19:58
markl_kind of a chicken & egg problem at the moment19:58
JanCmarkl_: about the upstart problem, you can try to log stuff yourself19:59
JanCadd some "echo blah >> logfile" stuff in the job configs19:59
markl_ok i'll give that a try.  it actually boots up and I can do: init 220:16
markl_so i'm really close20:16
diegowshi20:19
diegowsis there a way to execute an event on reboot/shutdown with upstart? I need to execute a script on reboot/shutdown before anything else (for example, before killing the xsession_20:20
diegows)20:20
JanCdiegows: before killing the X-session, why not do that with X session-management then?20:30
diegowsI haven't found the right place to do that20:32
diegowsgdm executes script on PostSession but X is killed before20:32
diegowsand with upstart is a more generic solution i think20:34
JanCon most systems, X is started by gdm, not by upstart...20:34
diegowsaha20:35
JanCmaybe this is useful: http://en.wikipedia.org/wiki/X_session_manager  ;)20:35
diegowsthat's ok20:36
diegowsbut something is killing gdm/X and i'm sure is upstart who is doing that20:36
diegowsso it should have a place to put an script before that event20:37
Keybuk"on stopping gdm" ?20:40
diegowsi think I tried that and didn't work20:44
diegowsbut i'll try again 20:45
diegowsjust in case20:45
diegows:-_20:45
JanCthat will start after X is stopped I assume?20:52
Keybukthat will start before gdm is stopped20:53
JanChe want to run something before X is stopped, so I suggested using X session management  ;)20:53
diegowsyeah, but X sessino mgmt doesn't have a place to insert a script before logout21:04
CaesarHey Keybuk wanna hear something funny21:27
KeybukCaesar: sure21:28
CaesarIt's not so funny now21:28
CaesarBut it was at the time21:28
CaesarWe have a custom rsyslog package that (currently) doesn't have an upstart job21:29
CaesarAnd we default to confold for everything21:29
CaesarSo we had to get the preinst to remove the Ubuntu rsyslog's upstart job21:29
CaesarBut that didn't get the idea of the job out of Upstart's head21:29
CaesarSo I kept trying to kill it, but it kept coming back21:30
Keybukright21:30
KeybukUpstart won't forget about it until you stop it ;)21:30
Caesarthe stop command has a good time when upstart knows about the job, but there's no job file21:30
Caesarstop: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist21:31
Keybukhuh that doesn't make sense21:36
Keybukif Upstart is respawning, it should still have an object21:36
Keybukjust tested that here, and it worked21:36
CaesarHmm21:37
CaesarI can only report what I was seeing21:37
* Caesar longs for Puppet to become knowledgable of Upstart21:40
Keybuk:)21:47

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!