/srv/irclogs.ubuntu.com/2009/10/12/#upstart.txt

seaniushi guys, is there an authoritative guide for job file syntax somewhere?  most of the stuuff on the upstart wiki seems more "proposal-ish"12:07
seaniusspecifically wrt the version in hardy12:08
Keybukman 5 init12:08
Keybukoh, in hardy, no12:08
seaniusyeah i've already heard through the grapevine that it might have changed since then12:09
Keybukyes, and it will change again12:10
seaniusshould i just forget about trying then, and use something like rc.local?12:10
* seanius would prefer inittab, but that's gone now it seems12:10
seaniusor, is inittab supported in the -compat-sysv package but just not shipped by default?12:12
seanius...it seems not (beyond default runlevel at least)12:20
Keybukit's not supported, no12:21
seaniussorry for flooding teh channel btw :)12:21
seaniusi have a service i'd like to run with supervision (i.e. "respawn") which should start after ssh/networking/postgres is brought up12:22
seaniusis this possible to do in hardy's 0.3.9 upstart?12:24
ionProbably best to start it when rc2 has finished. But i don’t remember the precise syntax for 0.3.12:29
ionSomething like12:30
ionstart on EVENTSPEC12:30
ionservice12:30
ionrespawn12:30
ionexec yourservice12:30
seaniusokay, i htink i can take that and what's sitting in event.d to try something, thanks!12:31
ionwhere EVENTSPEC is the correct string to match whatever happens when rc2 has finished.12:31
=== Keybuk_ is now known as Keybuk
seaniusion: okay so that would be something like "start on started rc2"?12:40
seanius...which is output from initctl events when i run "telinit 2"12:41
ionI take it there’s a /etc/event.d/rc2?12:41
seaniusyeah12:42
ionDo you get a ‘stopped rc2’ when rc2 finishes?12:42
seaniusi think i get that if i switch to runlevel 312:43
ionYou’ll probably want ‘start on stopped rc2’ or something like that.12:43
ionHmh, not that, then...12:43
seaniusyeah this is what i get http://paste.debian.net/48855/12:44
seaniusthis is switching from 2->3 and then back from 3->212:44
seaniusoh, it looks like it is saying "stopped rc2" last then isn't it...12:45
ionDid stopped rc2 happen before or just after switching to a new runlevel?12:45
seaniusit looks like it's the last thing that happens when switching *to* that runlevel12:46
seaniusso then i'd want "start on stopped rc2"12:46
ionAlright, that should work.12:46
seaniusand if i want to stop it on reboot/shutdown would that be "stop on runlevel [06]" ?12:47
ionLook at what the tty* jobs do, that should work.12:49
seaniusah, just multiple stop stanzas12:49
ionThe [016]-style pattern might only be supported in a newer version of Upstart.12:50
seaniusthere was a runlevel [!2] in the rc2 file at least12:50
ionOk, it probably would work then.12:51
seaniusallright, looks like we're up and running12:52
seaniusthanks for the help12:52
Keybukion: I think I always used fnmatch() for that13:23
=== sadmac2_ is now known as sadmac
akkHi! I updated karmic yesterday and now I can't boot with my self-compiled kernel -- mountall complains about /proc/filesystems, I think because I'm not using an initrd.18:22
akkI'm wondering if this is a permanent change, and if there's any workaround to boot without initrd?18:22
sadmacKeybuk: what are operations that one does on a device node that don't start with opening it and acting on the resulting descriptor?19:39
JanCakk: I've been looking at it a bit & I think a solution/workaround would be to edit the existing "mountall.conf" upstart script to add a 'pre-start' script that makes sure /proc (and maybe other requirements?) exist before mountall runs20:08
JanCbut Keybuk or somebody else probably knows more about what the "right" solution would be  ;)20:08
akkJanC: Thanks for looking! Wouldn't I have to delay running mountall at all until it had mounted root readonly?20:11
akkThough d found that mountall 0.1.8 worked (two revs back).20:12
JanCakk: whatever requirements mountall has should go in the pre-start script (or in a separate upstart job on which mountall depends?)20:16
chergertcan i have multiple "start on " lines in an upstart config? or do they need to be on one line?21:51
mugwumpAnyone have any tricks for debugging early boot process with upstart?22:08
Keybuksadmac: none that I can think of22:10
sadmac_Keybuk: well the mount command takes the path, but that can be gotten around...22:14
sadmac_Keybuk: a shocking proposal: axe device nodes. replace with connect(AF_DEVICE...)22:14
Keybuksadmac_: then you can't alias them ;)22:14
Keybukthe network people (who have this) are trying to go the other way22:14
Keybukakk: this is generally a channel for Upstream issues, try #ubuntu22:15
Keybukakk: though because I'm nice, see bug 44794722:15
sadmac_Keybuk: sure you can. DNS can alias IP addresses, why can't some similar service alias major/minor pairs?22:15
Keybuksadmac_: how so?22:15
Keybukchergert: no.22:16
Keybukmugwump: --debug on the kernel command-line is always fun22:16
Keybukbut you need quick reactions on the old scroll lock key ;)22:16
Keybuk(and a scroll lock key, bloody netbooks!)22:16
mugwumpheh22:16
mugwumpctrl+s does the same thing on the console, no?22:16
Keybukno...22:16
Keybuk:(22:16
akkKeybuk: Thanks!22:17
sadmac_Keybuk: basically you have a gethostbyname equivalent like getdevicebyname. you pass it a name, and it communicates to some service (probably a very re-invented udev) and returns a major/minor in a struct socaddr_device22:17
mugwumpwell, that's useful, thanks.  I actually ended up reinstalling because I couldn't figure out why the system wouldn't boot...22:17
Keybuksadmac_: device filesystems are a more popular way of doing that <g>22:18
sadmac_Keybuk: but they suck.22:18
mugwumpit would be nice to have details like that on the upstart man page22:18
Keybuksadmac_: the only API I can think of that sucks more is, err, DNS22:18
Keybukmugwump: it's a good point that init(8) doesn't document the options, could you file a bug about that?22:19
sadmac_Keybuk: if you tried out a web browser, and when you launched it instead of a website it gave you a blank window and the glade interface designer and said 'draw yourself a UI', and it did this every time you started it would you keep it?22:19
mugwumpto which bugtracker?22:19
mugwumplaunchpad?22:19
sadmac_Keybuk: by that logic, where the fuck does the kernel get off giving userspace a some-assembly-required interface to hardware?22:19
Keybukmugwump: http://launchpad.net/upstart/+reportbuf22:20
Keybukmugwump: http://launchpad.net/upstart/+reportbug22:20
* mugwump reports a buf22:20
Keybukit might be +filebug ;)22:20
mugwumpI'll find it :)22:20
mugwumpKeybuk: https://bugs.launchpad.net/upstart/+bug/44988322:26
mugwumpthough it would be nice to have an option which starts a shell or something and requires you to prod it to make the next event fire22:28
mugwumpquite often in that sort of situation I'll be doing diag checks between init scripts22:28
Keybukyes, we should have that22:29
Keybukin fact, my thought is that init will look at the kernel command-line options22:29
Keybukand if any job exists with the names given, it will start that22:29
mugwumpsure, why not22:29
Keybukso you could have /etc/init/emergency.conf containing the code for a console root shell22:29
mugwumpthe decision to run as real init, it makes that based on the pid, right?22:29
Keybukthen if you stuck emergency on the kernel command-line then it would give you that22:29
mugwumpthat sounds pretty clean22:30
Keybukthat'd same code would make implementing things like "single" really easy too22:30
Keybuk(and most importantly let the mobile phone developers *not* have that <g>)22:30
mugwumpdo you use lxc for testing already?22:30
mugwumpIt should let you start a process that thinks it's pid 122:31
mugwumpand can't see any other processs22:31
Keybukno, the test suite is pretty comprehensive though22:31
mugwumpah, good to know22:32
mugwumppresumably you mock that somehow in the test suite22:32
Keybukactually, very little requires that init be pid 122:32
Keybukthe only reason, in fact, is because sysv let people call init to change the runlevel ;)22:32
Keybukif you build upstart a certain way, you can cheerfully run it as any user22:32
Keybukand use that one for testing22:33
* Keybuk does that a lot22:33
mugwumpreparenting I would have thought was pretty important22:33
mugwumpor I guess not, maybe you only care about immediate children22:33
Keybuknot really, we don't get told about it22:33
mugwumpdo you get SIGCHLDs from them?22:33
Keybukeventually yes22:34
Keybukbut there's no use for that, because we don't know what process it was ;)22:34
Keybukpid 4131 died ... that's nice22:34
mugwumpheh22:34
Keybukkernel helpfully reaps info from /proc first22:34
Keybuknot that it would be reliable anyway22:34
mugwumpor portable... any bsd users?  :)22:35
KeybukI'm utterly uninterested in portability22:35
KeybukUpstart is a Linux program22:35
mugwumpfair enough, you won't find me complaining or submitting portability patches22:39
KeybukI've suggested to the Debian/kFreeBSD nutters that they branch the code and rewrite it to be a BSD program ;)22:39
sadmac_ugh. I keep getting to places where I want to commit, but I don't want to because it would mean committing or digging out the piles of printfs that I want to still be in place for the next phase of implementation.22:45
=== sadmac_ is now known as sadmac2
ionkeybuk: Btw, there’s the mnt->device "none" change sitting in my branch. Not very important, but anyway. :-)23:13
ionkeybuk: The latest commit in the mountall repo breaks the code. I’m not quite sure what it’s attempting to do.23:36
ionAh, now i get it. Yeah, just a missing ||23:37
ionkeybuk: Fix in my branch.23:39
Keybukoh, the fix is already in mine23:43
ionAlright23:43
ionuncommited and pushed; my branch still contains the (not very important) mnt->device "none" change.23:44
Keybukthe whuh?23:47
Keybukoh that, I'll merge that in23:47

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