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

Keybukion: I must get around to writing crazy zsh expansion for Upstart07:38
Keybuke.g. start <tab> not completing anything already running ;)07:38
ionYeah :-)07:39
Keybukbut first I should probably write more of Upstart07:41
shan3hi all!13:46
shan3I have read the getting started page http://upstart.ubuntu.com/getting-started.html but I have a question for which I can't seem to find an answer on the site.13:47
shan3Are there any special characteristics required for a script that is run by Upstart13:47
shan3?13:47
shan3I have a 'traditional' service script that forks to the background and I tried many different methods inclusing using states... But I can't get it to start13:49
shan3*including13:49
shan3running the script from command line works fine13:50
shan3Hi all. Any idea why a simple job like this: http://pastebin.com/Q6mkJzzw doesn't work?20:00
sadmacshan3: looks like it would need the task keyword, since the script exits.20:05
* shan3 google task keyword20:06
sadmacman 5 init is the docs20:07
shan3sadmac: what about using the 'service' option and having a pre-start script instead... ?20:08
shan3http://wiki.frugalware.org/index.php/Upstart_Job_HOWTO < says we can do that instead of script or exec20:09
sadmacshan3: oh, for what it looks like you want to do that's right20:11
sadmacshan3: except no service option if you're using the latest version20:12
shan3sadmac: hm... if I use pre-start script, upstart doesn't even recognize my job as a job...20:13
sadmacshan3: what version of upstart is this?20:13
shan3the one in Ubuntu 10.04 RC20:14
shan30.6.520:14
ionA typo or invalid syntax somewhere?20:14
shan3let me try again using pre-start script without the service option... 20:15
shan3that's about all I've been changing20:15
sadmacshan3: the service option is no longer supported20:17
sadmacshan3: its bad syntax20:17
shan3Hm... so then what is the right way to run a script that exits in a job?...20:20
ionMake it a pre-start/post-start script or make the job a task by using the ‘task’ stanza.20:21
shan3ion: Thanks... I'll have to read the latest docs... seems like I've been reading outdated ones and pulling my hair out.20:22
ioninit(5) as sadmac said.20:24
shan3yup... got it.20:25
LzrdKingwoah, it exists!20:31
sadmacLzrdKing: yes. welcome to the pocket dimension of xindu20:31
LzrdKingoh, i musty be on the worng place20:32
LzrdKingwoah, typos galore!20:32
LzrdKingi must be in the wrong place*20:32
LzrdKinghow can i use upstart to bring up my wireless as soon as wlan0 is visible to the kernel?20:33
sadmacLzrdKing: you need to have udev run initctl emit something so you get an event when that happens20:33
LzrdKinghow do i get udev to do that?20:34
sadmacLzrdKing: ask in #udev :)20:34
sadmacLzrdKing: depending on your distro maybe something of the kind is already set up20:34
KeybukSUBSYSTEM=="net", RUN+="/sbin/initctl emit ..."20:35
LzrdKingi don't think so, as much as i've tried, i can't get wlan0 up before a mountall happens, whch tries to mount nfs shares20:35
sadmacnfs + wireless + boot-essential = cry20:36
LzrdKingso i can have udev emit anything that the upstart sctips then looks for?20:36
LzrdKingscripts*20:36
sadmacLzrdKing: indeed.20:36
Keybukif you have mountall, it sounds like you're running Ubuntu20:37
LzrdKingso if it emits "wirelessnetworkvisible" then the upstart script should have "start on wirelessnetworkvisible"?20:38
LzrdKingKeybuk: yes, karmic20:38
Keybukthen you will already have events from udev 20:38
Keybuke.g. net-device-added wlan020:38
Keybukwhich will already run "ifup wlan0" if you have wlan0 configured in /etc/network/interfaces20:38
LzrdKingi do, but that mountall comes along to early20:39
LzrdKingshouldn't udev emit that event before anything in rcS.d/ is run?20:40
sadmacLzrdKing: you may be able to add "and net-device-up wlan0" to mountall's start conditions. Maybe.20:40
LzrdKingi need the "and" for mutliple requirements?20:41
sadmacLzrdKing: yes, but the "and" has some quirks and surprises20:42
LzrdKinglike what?20:42
sadmacLzrdKing: if you have a job that says start on starting foo and bar, foo will get stuck in the starting state until bar comes along, because its starting event won't get retired until that condition is met, even though its in another job.20:44
LzrdKingmaybe i'll just take my nfs shares out of fstab and mount them manually in rc.local...20:45
sadmacLzrdKing: or make them noauto in fstab and mount them in rc.local20:45
=== Keybuk changed the topic of #upstart to: Upstart 0.6.6 "No, she's dead, this is her son" | http://upstart.ubuntu.com/
* sadmac counts the minutes until someone who barely speaks english and whom he's never seen before or will see again files a Fedora bug suggesting we update the Upstart package without articulating any particular need for it.20:47
LzrdKingnew version?20:48
Keybukyeah, nothing really important in it - just wanted to flush it out20:49
Keybukmain reason is that whatever gettext I used for 0.6.3+0.6.5 had files generated against the GPLv3 version of Bison20:49
LzrdKingsadmac: if i use noauto then mount -a won't mount it?20:49
sadmacLzrdKing: yes20:50
LzrdKingKeybuk: terrible20:50
LzrdKingsadmac: have you tired to get wireless+nfs up at boot time before?20:51
sadmacLzrdKing: no. I also don't use Ubuntu :) but I don't think the maintainers of any of those components are expecting to work with oneanother20:52
LzrdKingsadmac: you said it was "cry"20:52
LzrdKingso i thought you tried and failed miserably, as i am20:52
sadmacLzrdKing: I'm crying at the idea.20:53
LzrdKingit really shouldn;t be that hard, i mean, all i need to do to bring up wlan0 is "iwconfig wlan0 essid myESSID; dhclient wlano"20:54
LzrdKingoops, wlan020:54
KeybukLzrdKing: did you add it to /etc/network/interfaces ?20:55
LzrdKingKeybuk: yeah i did20:55
Keybukthat's all you should need to do20:56
LzrdKingit didn't seem to make any change 20:56
LzrdKingplus i have the iwconfig/dhclient command isn a script, plus i installed wicd20:56
LzrdKings/isn/in20:56
LzrdKingstartup scripts need to be organized better20:57
LzrdKingso people can figure out whats going on20:57
sadmacKeybuk: what's the new codename from?20:57
LzrdKingrc#.d/ was easy to understand, upstart is hard21:00
ionrc#.d was full of race conditions and ugly workarounds that may or may not have worked.21:10
LzrdKingbut i understood what was happening21:10
LzrdKingi will understand upstart, eventually21:11
LzrdKingmessaging is wierd, things become so loosely connected now21:11
JanCin the past things weren't connected at all  ;)21:41
LzrdKingsure they were, program a called program b21:43
LzrdKingbut that was it21:43
Keybukyes, you knew that for a program to be started after networking was up, it had to be replaced with a number "higher than 40" in "runlevel 2"21:43
Keybukin Ubuntu21:43
Keybukbut in Debian that had to be "higher than 35" in "runlevel S"21:43
Keybukand in Fedora that had to be "any value" in "runlevel 3 or 5"21:43
Keybuketc.21:43
LzrdKingbut it was easy to look at the directory listings and link your script into an existing runlevel startup21:44
JanCI think there are some plans to make it possible to map what was started by what21:46
LzrdKingi just need to learn the new system, then i'll say, boy that sysv crap sure was backwards21:47
shan3Is it possible to use bash instead of sh for upstart jobs?22:57
ionexec /path/to/bash-script23:19

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