[18:24] how do i launch upstart? do i need to tell the kernel to run upstart instead of init? [18:24] 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 vm [18:27] ah ok upstart provides /sbin/init. ok now i am really sad [18:30] why sad? [18:30] because it is ending up at runlevel unknown and i'm not sure what to check next [18:31] but at least i get plymouthd :) [18:31] w00t [18:31] is there a way to get logging out of upstart's init? [18:31] since it isn't launching syslog [18:36] init 2 seems to at least do something [18:37] markl_: you could go into /etc/init.d/rc and set a default runlevel [18:37] markl_: normally that file gets it out of inittab [18:37] markl_: but ultimately this is an ubuntu question not an upstart question [19:35] sadmac: yeah this problem will overlap 3 different projects, upstart, ubuntu, openvz. fun stuff! [19:35] sadmac: is there a good faq that covers this kind of thing? [19:36] markl_: 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] markl_: mostly the manpages though. [19:36] my main question is why rc-sysinit.conf isn't setting it [19:37] isn't that the correct place to set the default runlevel? [19:37] markl_: thats an ubuntu decision [19:37] 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:38] markl_: that begs the question: do you even want to have runlevels? [19:38] for bootup [19:38] yes i would prefer them [19:39] it was my understanding that the kernel runs init, which will start with rc-sysinint.conf [19:39] kind of like how the old init started with inittab [19:39] markl_: 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:40] is this what ubuntu does? [19:40] markl_: yep. Fedora does it too, but the implementations are slightly different. [19:40] of course :) [19:41] I suppose other upstart-users like android probably don't use runlevels [19:41] I'd have to look but I'd bet not [19:42] markl_: so when upstart starts, it emits the "startup" event, thus triggering anything that has "start on startup" in its conf file. [19:42] 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 something [19:42] markl_: rc-sysinit.conf would be one of those I'd imagine [19:42] so if my event.d directory is empty, is that a bad sign? [19:42] markl_: it'll log to syslog, or console if that's not around. [19:42] no console [19:42] markl_: ...depends on the version of upstart. newere upstarts use /etc/init.d [19:42] (0.6 and later) [19:43] 0.6.5-4 [19:43] yeah, then I'm surprised you have an event.d [19:43] ok maybe the page i found with google was outdated [19:43] almost certainly [19:43] well it includes a script to convert inittab to upstart [19:44] upstart 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 case [19:44] ok thanks, this is very helpful [19:45] newer versiosn use /etc/init/ (not init.d !) [19:45] then 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] JanC: right. my fault. [19:46] and that's how most distros build their sysv layer. [19:46] i have both /etc/init and /etc/init.d. [19:47] markl_: yeah, init.d is something else :) [19:47] init.d contains all the sysvinit scripts [19:47] init.d is for sysvinit scripts that get run by the sysvinit compatibility stuff [19:47] (so not really an upstart thing per se. sysvinit holdover) [19:47] ok cool, thanks for being so tolerant of 100% total n00b questions :) [19:48] markl_: you might want to read "man 5 init" [19:50] hmm, so rc-sysinit isn't a script as such, is it? [19:50] if i just remove /dev/console, will it create a log file for me? [19:50] markl_: no [19:50] markl_: advise serial console [19:50] no serial ports [19:51] markl_: start syslog earlier then [19:51] 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.conf [19:51] you can get a serial console over USB too of course [19:51] * sadmac 's virtual machines all have consoles... [19:51] serial or video... [19:51] (USB is a serial port) [19:52] openvz doesn't use a virtual machine AFAIK, but uses some container-like technology? [19:53] they probably implemented something similar though [19:53] yes it basically starts init in a chroot [19:53] but with lots of fun kernel mods to control memory etc better [19:54] and the vm's typically run without getty or any sort of console [19:54] kind of like driving a stick whereas the other vm's are an automatic [19:55] markl_: AFAIK something similar ('lc' or "linux containers") is being implemented in the mainline kernel nowadays [19:56] yeah, the main gripe with VZ is that their kernel patch is gigantic with no hope of linus accepting it all [19:56] so they are moving things into the main kernel as time goes on, which lxc is trying to use [19:57] the LC people did cut up their patches in small chunks for linus to approve one by one ;) [19:57] yep, smart move [19:57] or lxc [19:57] i'm glad that parallels is getting openvz out for 2.6.32 (rhel6, ubuntu 10.04, debian squeeze) [19:58] 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 kernel [19:58] kind of a chicken & egg problem at the moment [19:59] markl_: about the upstart problem, you can try to log stuff yourself [19:59] add some "echo blah >> logfile" stuff in the job configs [20:16] ok i'll give that a try. it actually boots up and I can do: init 2 [20:16] so i'm really close [20:19] hi [20:20] is 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] ) [20:30] diegows: before killing the X-session, why not do that with X session-management then? [20:32] I haven't found the right place to do that [20:32] gdm executes script on PostSession but X is killed before [20:34] and with upstart is a more generic solution i think [20:34] on most systems, X is started by gdm, not by upstart... [20:35] aha [20:35] maybe this is useful: http://en.wikipedia.org/wiki/X_session_manager ;) [20:36] that's ok [20:36] but something is killing gdm/X and i'm sure is upstart who is doing that [20:37] so it should have a place to put an script before that event [20:40] "on stopping gdm" ? [20:44] i think I tried that and didn't work [20:45] but i'll try again [20:45] just in case [20:45] :-_ [20:52] that will start after X is stopped I assume? [20:53] that will start before gdm is stopped [20:53] he want to run something before X is stopped, so I suggested using X session management ;) [21:04] yeah, but X sessino mgmt doesn't have a place to insert a script before logout [21:27] Hey Keybuk wanna hear something funny [21:28] Caesar: sure [21:28] It's not so funny now [21:28] But it was at the time [21:29] We have a custom rsyslog package that (currently) doesn't have an upstart job [21:29] And we default to confold for everything [21:29] So we had to get the preinst to remove the Ubuntu rsyslog's upstart job [21:29] But that didn't get the idea of the job out of Upstart's head [21:30] So I kept trying to kill it, but it kept coming back [21:30] right [21:30] Upstart won't forget about it until you stop it ;) [21:30] the stop command has a good time when upstart knows about the job, but there's no job file [21:31] stop: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist [21:36] huh that doesn't make sense [21:36] if Upstart is respawning, it should still have an object [21:36] just tested that here, and it worked [21:37] Hmm [21:37] I can only report what I was seeing [21:40] * Caesar longs for Puppet to become knowledgable of Upstart [21:47] :)