Keybuk | ion: I must get around to writing crazy zsh expansion for Upstart | 07:38 |
---|---|---|
Keybuk | e.g. start <tab> not completing anything already running ;) | 07:38 |
ion | Yeah :-) | 07:39 |
Keybuk | but first I should probably write more of Upstart | 07:41 |
shan3 | hi all! | 13:46 |
shan3 | I 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 |
shan3 | Are there any special characteristics required for a script that is run by Upstart | 13:47 |
shan3 | ? | 13:47 |
shan3 | I 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 start | 13:49 |
shan3 | *including | 13:49 |
shan3 | running the script from command line works fine | 13:50 |
shan3 | Hi all. Any idea why a simple job like this: http://pastebin.com/Q6mkJzzw doesn't work? | 20:00 |
sadmac | shan3: looks like it would need the task keyword, since the script exits. | 20:05 |
* shan3 google task keyword | 20:06 | |
sadmac | man 5 init is the docs | 20:07 |
shan3 | sadmac: what about using the 'service' option and having a pre-start script instead... ? | 20:08 |
shan3 | http://wiki.frugalware.org/index.php/Upstart_Job_HOWTO < says we can do that instead of script or exec | 20:09 |
sadmac | shan3: oh, for what it looks like you want to do that's right | 20:11 |
sadmac | shan3: except no service option if you're using the latest version | 20:12 |
shan3 | sadmac: hm... if I use pre-start script, upstart doesn't even recognize my job as a job... | 20:13 |
sadmac | shan3: what version of upstart is this? | 20:13 |
shan3 | the one in Ubuntu 10.04 RC | 20:14 |
shan3 | 0.6.5 | 20:14 |
ion | A typo or invalid syntax somewhere? | 20:14 |
shan3 | let me try again using pre-start script without the service option... | 20:15 |
shan3 | that's about all I've been changing | 20:15 |
sadmac | shan3: the service option is no longer supported | 20:17 |
sadmac | shan3: its bad syntax | 20:17 |
shan3 | Hm... so then what is the right way to run a script that exits in a job?... | 20:20 |
ion | Make it a pre-start/post-start script or make the job a task by using the ‘task’ stanza. | 20:21 |
shan3 | ion: Thanks... I'll have to read the latest docs... seems like I've been reading outdated ones and pulling my hair out. | 20:22 |
ion | init(5) as sadmac said. | 20:24 |
shan3 | yup... got it. | 20:25 |
LzrdKing | woah, it exists! | 20:31 |
sadmac | LzrdKing: yes. welcome to the pocket dimension of xindu | 20:31 |
LzrdKing | oh, i musty be on the worng place | 20:32 |
LzrdKing | woah, typos galore! | 20:32 |
LzrdKing | i must be in the wrong place* | 20:32 |
LzrdKing | how can i use upstart to bring up my wireless as soon as wlan0 is visible to the kernel? | 20:33 |
sadmac | LzrdKing: you need to have udev run initctl emit something so you get an event when that happens | 20:33 |
LzrdKing | how do i get udev to do that? | 20:34 |
sadmac | LzrdKing: ask in #udev :) | 20:34 |
sadmac | LzrdKing: depending on your distro maybe something of the kind is already set up | 20:34 |
Keybuk | SUBSYSTEM=="net", RUN+="/sbin/initctl emit ..." | 20:35 |
LzrdKing | i 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 shares | 20:35 |
sadmac | nfs + wireless + boot-essential = cry | 20:36 |
LzrdKing | so i can have udev emit anything that the upstart sctips then looks for? | 20:36 |
LzrdKing | scripts* | 20:36 |
sadmac | LzrdKing: indeed. | 20:36 |
Keybuk | if you have mountall, it sounds like you're running Ubuntu | 20:37 |
LzrdKing | so if it emits "wirelessnetworkvisible" then the upstart script should have "start on wirelessnetworkvisible"? | 20:38 |
LzrdKing | Keybuk: yes, karmic | 20:38 |
Keybuk | then you will already have events from udev | 20:38 |
Keybuk | e.g. net-device-added wlan0 | 20:38 |
Keybuk | which will already run "ifup wlan0" if you have wlan0 configured in /etc/network/interfaces | 20:38 |
LzrdKing | i do, but that mountall comes along to early | 20:39 |
LzrdKing | shouldn't udev emit that event before anything in rcS.d/ is run? | 20:40 |
sadmac | LzrdKing: you may be able to add "and net-device-up wlan0" to mountall's start conditions. Maybe. | 20:40 |
LzrdKing | i need the "and" for mutliple requirements? | 20:41 |
sadmac | LzrdKing: yes, but the "and" has some quirks and surprises | 20:42 |
LzrdKing | like what? | 20:42 |
sadmac | LzrdKing: 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 |
LzrdKing | maybe i'll just take my nfs shares out of fstab and mount them manually in rc.local... | 20:45 |
sadmac | LzrdKing: or make them noauto in fstab and mount them in rc.local | 20: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 | |
LzrdKing | new version? | 20:48 |
Keybuk | yeah, nothing really important in it - just wanted to flush it out | 20:49 |
Keybuk | main reason is that whatever gettext I used for 0.6.3+0.6.5 had files generated against the GPLv3 version of Bison | 20:49 |
LzrdKing | sadmac: if i use noauto then mount -a won't mount it? | 20:49 |
sadmac | LzrdKing: yes | 20:50 |
LzrdKing | Keybuk: terrible | 20:50 |
LzrdKing | sadmac: have you tired to get wireless+nfs up at boot time before? | 20:51 |
sadmac | LzrdKing: no. I also don't use Ubuntu :) but I don't think the maintainers of any of those components are expecting to work with oneanother | 20:52 |
LzrdKing | sadmac: you said it was "cry" | 20:52 |
LzrdKing | so i thought you tried and failed miserably, as i am | 20:52 |
sadmac | LzrdKing: I'm crying at the idea. | 20:53 |
LzrdKing | it 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 |
LzrdKing | oops, wlan0 | 20:54 |
Keybuk | LzrdKing: did you add it to /etc/network/interfaces ? | 20:55 |
LzrdKing | Keybuk: yeah i did | 20:55 |
Keybuk | that's all you should need to do | 20:56 |
LzrdKing | it didn't seem to make any change | 20:56 |
LzrdKing | plus i have the iwconfig/dhclient command isn a script, plus i installed wicd | 20:56 |
LzrdKing | s/isn/in | 20:56 |
LzrdKing | startup scripts need to be organized better | 20:57 |
LzrdKing | so people can figure out whats going on | 20:57 |
sadmac | Keybuk: what's the new codename from? | 20:57 |
LzrdKing | rc#.d/ was easy to understand, upstart is hard | 21:00 |
ion | rc#.d was full of race conditions and ugly workarounds that may or may not have worked. | 21:10 |
LzrdKing | but i understood what was happening | 21:10 |
LzrdKing | i will understand upstart, eventually | 21:11 |
LzrdKing | messaging is wierd, things become so loosely connected now | 21:11 |
JanC | in the past things weren't connected at all ;) | 21:41 |
LzrdKing | sure they were, program a called program b | 21:43 |
LzrdKing | but that was it | 21:43 |
Keybuk | yes, 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 |
Keybuk | in Ubuntu | 21:43 |
Keybuk | but in Debian that had to be "higher than 35" in "runlevel S" | 21:43 |
Keybuk | and in Fedora that had to be "any value" in "runlevel 3 or 5" | 21:43 |
Keybuk | etc. | 21:43 |
LzrdKing | but it was easy to look at the directory listings and link your script into an existing runlevel startup | 21:44 |
JanC | I think there are some plans to make it possible to map what was started by what | 21:46 |
LzrdKing | i just need to learn the new system, then i'll say, boy that sysv crap sure was backwards | 21:47 |
shan3 | Is it possible to use bash instead of sh for upstart jobs? | 22:57 |
ion | exec /path/to/bash-script | 23:19 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!