/srv/irclogs.ubuntu.com/2007/05/30/#upstart.txt

=== ion_ [i=ion@heh.fi] has joined #upstart
=== ion_ [i=ion@heh.fi] has joined #upstart
=== AlexExtreme looks through his logs to find that profiles discussion
AlexExtremeoops10:12
=== ion_ [i=ion@heh.fi] has joined #upstart
=== Keybuk [n=scott@quest.netsplit.com] has joined #upstart
=== jonibo [n=jonas@213.212.2.165] has joined #upstart
=== Md [i=md@freenode/staff/md] has joined #upstart
=== Md [i=md@freenode/staff/md] has joined #upstart
=== eroyf [n=eroyf@gentoo/developer/paludis.minion.eroyf] has joined #upstart
=== tale [n=tale@207.235.54.1] has joined #upstart
=== asdaf [n=Ack@213-140-11-128.fastres.net] has joined #upstart
asdafhello, I have a question, is there any way to prevent script stanzas to be executed by a shell with -e option?03:53
ion_Why would you not want -e?04:02
AlexExtremeyou can easily prevent the script from terminating if a certain command fails by putting || true after the command04:02
asdafion_, sometimes is a bit constraining04:04
asdafyou may want to let something fail ignoring the failure04:05
AlexExtreme<AlexExtreme> you can easily prevent the script from terminating if a certain command fails by putting || true after the command04:05
AlexExtremeyou can ^^04:05
asdafAlexExtreme, that's what I'm doing04:05
asdafbut it's not very elegant to put a lot of ||true  in the scripts :)04:06
asdafI agree -e should be the normal behaviour04:06
asdafbut I think it may be useful to have a way to switch off this option04:06
asdafsay an option in the job description04:07
AlexExtremeor do like this:04:07
AlexExtremepre-start script nofail04:08
AlexExtreme   blah04:08
AlexExtremeend script04:08
asdafIs this an already implemented option?04:08
AlexExtremeno, i'm saying an example of how it could be implemented :)04:09
AlexExtremeif it were implemented i would have told you in the first place :)04:09
asdafAlexExtreme, ok :) this would be nice 04:09
Keybukwhy not just put "set +e" at the top of the script?04:10
Keybukpre-start script04:10
Keybuk    set +e04:10
Keybuk    # broken stuff04:10
Keybukend script04:10
AlexExtremehmm. that's a point04:10
AlexExtremei'm forgetful sometimes ;)04:11
asdafKeybuk, right, that's the easiest way :)04:26
asdafbut i like the syntax AlexExtreme proposed :)04:27
AlexExtremewell, if there's a way to do it already a new syntax would be pointless04:27
asdafAlexExtreme, it's just semantic sugar, but maybe putting it into the script declaration would be more explicit04:32
AlexExtrememaybe04:33
KeybukI don't really see the need for the semantic sugar04:34
Keybuk-e is a sensible default, and sh gives you a mechanism to turn it off04:34
=== rgl [n=Rui@84.90.10.107] has joined #upstart
rglhi04:36
rglon ubuntu edgy upstart is not installed by default?04:37
AlexExtremeit is04:38
rglmine is not :|04:39
rglI've upgraded from previous version.04:39
AlexExtremedid you upgrade from an older version?04:39
AlexExtremeah04:39
rgloh, but I did an aptget update, and now it wants to install upstart04:39
Keybukthe Ubuntu release notes recommend the dist-upgrader tool over apt-get04:56
Keybukwhat's happened is APT has refused to remove the previously Essential sysvinit04:56
Keybukwithout taking into account that sysvinit is no longer Essential, and has been replaced by Upstart04:56
rgloh, I see.05:19
rglwhy is the need for anther tool? :|05:19
rglhumm, but after this apt-get dist-upgrade, the sysvinit was removed, and replaced with upstart.05:21
rglhumm, not when I do an "apt-get install" it says: 0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.05:22
rglbut how can I see the "29 not upgraded"?05:23
rglhow, they show up when I do: apt-get -s dist-upgrade ...05:24
rglhow can I see the reason for holding back a package?   the 29 packages are all python-* ones05:25
=== juergbi [n=juerg@80-219-19-101.dclient.hispeed.ch] has joined #upstart
rglis there a upstart manual?  some place that shows what events are availble?07:30
Keybukany event you emit with initctl is available07:30
rglbut where are the standard ones defined? 07:32
=== rgl "initctl emit " does not work with 0.2.7
Keybukthey aren't at this point07:34
KeybukUpstart is still in development, as are the sets of "standard" events07:34
rgloh ok.07:35
rglthe "restart" stanza restarts the daemon if it dies, correct?   and "exec" only starts it once?07:36
AlexExtremeit's respawn07:36
rgloh yes.  "respawn", my bad hehe07:37
Keybukyou shouldn't use "respawn SOMETHING"07:38
Keybukuse07:38
Keybukrespawn07:38
Keybukexec /sbin/daemon07:38
Keybuk-- 07:38
Keybukotherwise you'll be bitten when you upgrade to 0.3.x (which only permits respawn on its own line007:38
rglKeybuk, oh, I saw the respawn line on "logd", and it has no exec :|07:39
Keybuksure, because the same file in 0.3.x has two lines07:39
rglhow can I do this: have a "php-fastcgi" service that does nothing (it just emits the "php-fastcgi" event) and have several "php-fascgi-1", "php-fascgi-2", etc, that are started/stop when ""php-fascgi" is started/stoped?07:42
rglI can just "exec /bin/true" on "php-fastcgi", and "start on php-fastcgi" on the "php-fastcgi-N"?07:43
Keybukwhy do you want to do that?07:47
rglI want to start several PHP FastCGI instances without having to start each one by hand.07:49
esrKeybuk: Sounds like you're an upstart core dev.07:50
rglI mean, I want to "start php-fcgi" and let upstart do a "start php-fcgi-N" for all the PHP FastCGI instances I've defined.07:50
Keybukare the instances different in configuration?07:51
Keybukesr: s/an/the/ :-)07:51
rglKeybuk, they are.  each one open a different unix domain socket.07:51
Keybukok; yeah you could do pretty much what you describe07:53
Keybukthough the exec /bin/true would terminate and you couldn't stop them with the same command07:53
rglhow? :)07:53
rglyeah, I've did that.  and it just fails to start the other PHP instances *G*07:53
Keybukyou're using 0.2.7?07:53
rglthe alternative was to have a master one, but if that master dies for some reason, it will brong the other instances down, and then up again.  which is not good :(07:54
rglKeybuk, yes.  0.2.7 on edgy.07:54
Keybuktry start on php-fastcgi/started07:54
=== Keybuk tries to remember the syntax
Keybukthere's an interesting use case for instances here07:55
rglKeybuk, like http://pastie.caboo.se/66161  ?07:58
Keybukyes, though it'll stop pretty quick07:58
Keybuksince "/bin/true" doesn't last long07:58
=== evand [n=evand@ubuntu/member/evand] has joined #upstart
rglyeah.  so, no good07:58
=== bac [n=bac@canonical/launchpad/bac] has joined #upstart
rglI would be nice to have "virtual" services, that is, a service with no "exec" is a "virtual" service;  when you "start" a virtual service it just "remebers" it is started, and so on.08:00
AlexExtremeif you use 0.3 you can simply define a job without any exec for the main job iirc08:00
Keybukrgl: we have those ;-)08:00
rglah cool :) :)08:00
Keybukoh08:00
Keybukrandom bug on your paste08:00
Keybukyou need "runlevel-2" and "runlevel-1"08:00
rglKeybuk, oh, thats a bug on the wiki page then! *G*08:01
Keybukthe wiki documents 0.3.808:01
rglactually, http://upstart.ubuntu.com/getting-started.html08:01
rglis there a backport of 0.3.8 to edgy?  or I can just recompile, and go with it?08:02
AlexExtremeyou'd be better off upgrading to feisty IMO08:02
Keybukyou can probably just download the packages from feisty and install them08:02
Keybuk(YMMV, NUSPIS, WVIR)08:02
rglAlexExtreme, I can't right now.08:02
rglcan I go away with just upgrading the upstart package?  or do I have to upgrade all upstart-* ?08:05
Keybukall08:05
Keybukupstart, upstart-compat-sysv, system-services, startup-tasks, etc.08:05
rgl"etc" is "upstart-logd"? :)08:08
=== bac [n=bac@canonical/launchpad/bac] has left #upstart []
Keybukright08:09
=== Keybuk postulates
Keybuk    instance08:09
Keybuk    for file-exists /etc/event.d/php-fcgi-*08:10
Keybuk(err, /var/run/php/fcgi.*)08:10
Keybuk    exec /usr/bin/php5-cgi -b $FILE08:10
Keybukbit sticky, but that might work in 0.508:10
rgloh:08:13
rgldpkg: regarding upstart_0.3.8-1_i386.deb containing upstart, pre-dependency problem:08:13
rgl upstart pre-depends on libc6 (>= 2.5-0ubuntu1)08:13
rgl  libc6 is installed, but is version 2.4-1ubuntu12.3.08:13
Keybukoh08:13
Keybukmeh, you'd have to rebuild then08:13
Keybukcrappy packaging system08:13
rglbut the damn think installated the other packages ... oh oh08:13
Keybukyou should find packages to downgrade to in /var/cache/apt/archives08:14
Keybukif not, download them again08:14
AlexExtremedpkg is crappy or just the dependencies? ;)08:14
KeybukAlexExtreme: both :p08:14
AlexExtreme:)08:14
Keybukactjal,08:14
Keybukactually08:14
Keybukdpkg is crappy08:14
Keybuksince the packages *do* have dependencies, that doesn't stop dpkg from overwriting the old ones though08:14
rglKeybuk, what do you mean with "0.5"?08:15
Keybukrgl: 0.5 is the version of upstart I'm working towards at the moment; it has a few interesting features08:15
esrKeybuk: Are the System V runlevels going to continue to have any real meaning in an upstart environment?  I'm asking because I've written a workalike of chkconfig that uses update-rc.d as a back end.08:16
Keybukesr: we're always going to have to support packages that assume System V, because they'll exist for as long as vendors support them08:16
rglKeybuk, humm, so I can't make it work with 0.3.8?08:16
Keybukrgl: you can do it your way with 0.3.8 (have a master job, and use it to start/stop other jobs)08:17
Keybukesr: so we'll always ship jobs that run the legacy sysv-rc script08:17
Keybukesr: I don't think that runlevels make much sense in a pure Upstart environment, since they're pretty arbitrary and poorly defined across even Linux distros08:17
esrCan I give you a copy of my chkconfig clone to package with upstart, then?  Some third-party apps expecting a System-V like runlevel setup actually depend on it.08:18
=== AlexExtreme currently runs a system with absolutely no /etc/rc.d at all ;)
esrIt's pure bash plus sed.  There's a man page.08:19
Keybukesr: it'd certainly make sense to have it packaged in Ubuntu08:19
esrThat's what I'm thinking.  I'm running Ubuntu and it's the environmrnt I wrote chkconfig for.08:20
AlexExtremehmm, dot compiled with pango and cairo support makes the state machine diagram look so much better :P08:25
esrKeybuk: Where should I mail the code and man page for your consideration?08:27
AlexExtremeupstart-devel@lists.ubuntu.com08:27
KeybukAlexExtreme: got a patch?  I can fix our graphviz <g>08:28
AlexExtremehold on08:29
AlexExtremehttp://ftp.frugalware.org/pub/frugalware/frugalware-current/source/xapps-extra/graphviz/FrugalBuild << the necessary depends and compile options are in there08:30
Keybukcould you mail that me (scott@ubuntu.com); I'm in the middle of three things right now :-/08:31
AlexExtremesure08:31
AlexExtremedone08:32
esrKeybuk: Code and man page mailed.  And best of luck on the world domination thing -- I think upstart is very elegant, I'd like to see it win.08:48
Keybukthanks08:50
rglKeybuk, so, you are working on 0.5, but is there a 0.4? :D09:08
rglKeybuk, humm, as of 0.3.8, the logd service still uses respawn /sbin/logd09:15
Keybukno, there's no 0.409:20
rglACK :D09:20
AlexExtreme<curiousity>why not?</curiousity>09:21
rgloh, there seems to be a bug on 0.3.8.  when you do a "start php-fcgi" (my service that does no have a exec), start never ends :-(09:21
rglit stays at prompt waiting for something (stdin?)09:22
AlexExtremeyou need to put the service keyword in the job file09:22
AlexExtremeotherwise initctl assumes that it needs to wait for something to finish ;)09:22
rglwhat service keyword? :D09:23
AlexExtremejust write a line saying 'service' in the job file09:23
rglhumm, but what is initctl waiting for?  there is no exec line, so, why not assumer "service" automatically?09:24
AlexExtremewell09:24
rglAlexExtreme, that did the trick.  thx :D09:25
AlexExtremea job without anything to run is a state afaik, so initctl will remain running while the system is in that 'state'. once it is stopped initctl will exit09:25
rglyou are talking chinese to me hehe09:26
AlexExtremeheh ;)09:27
rglthere is a "start", a "stop", but well, no "restart", howcome? *G*09:28
rgl(comand line utility that is ;)09:28
AlexExtremeif you want a restart, simply write a script :)09:28
AlexExtreme#!/bin/bash09:28
AlexExtremestop $1 && start $109:29
rglwhy not follow the route of red-hat with "service start service-name"?09:29
AlexExtreme:)09:29
rglOT: how do I extract the number from the string "php-fcgi-1" using bash? :|09:38
rglecho php-fcgi-1 | sed 's,.*-(\\d+),\\1,g' does not seem to do the trick :(09:38
=== evand [n=evand@ubuntu/member/evand] has left #upstart []
rglhow do I get the name of the service file from within a "script" block?10:00
rglgot it... its the UPSTART_JOB env variable (read from http://upstart.ubuntu.com/wiki/JobEnvironmentVariable)10:03
rglhow, why do I need to have a "service" keyword on the service file? :|10:12
rglcan't make this work :(10:23
rglcan you look at http://pastie.caboo.se/66237 ?10:23
=== Md [i=md@freenode/staff/md] has joined #upstart
=== mbiebl [n=michael@p549CDD20.dip.t-dialin.net] has joined #upstart
=== rgl_ [n=Rui@84.90.10.107] has joined #upstart

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