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