#upstart 2006-10-23
<Luna-Tick> Hi all. I filed https://launchpad.net/bugs/67301 about some strange hanging that has started happening for me on boot. I think that it belongs where I filed it, but I was hoping someone here could check that it wasn't meant to be filed against upstart instead.
<Luna-Tick> ... Well, thanks for your help. Ciao
<johnnybuoy|gento> heh
<agent> does anyone know what exact command finds out when is the appropriate time to do a fsck on boot?
<johnnybuoy|gento> agent, that's in your fs properties
<johnnybuoy|gento> you can check it with e2fstune
<johnnybuoy|gento> agent, 'man e2fstune'
<johnnybuoy|gento> agent, you're using ext3, right?
<agent> yes, thank ypu
<agent> err you :)
<johnnybuoy|gento> np
<agent> errr... i dont have e2fstune ;)
<agent> i have e2fsck
<johnnybuoy|gento> agent, that`s no good
<johnnybuoy|gento> you need e2fsprogs
<agent> there is tune2fs :)
<johnnybuoy|gento> sudo apt-get install e2fsprogs
<agent> well, if i dont have it on my system that means that some other prog is doing the check to see when it should invoke a fsck
<_ion> I don't know whether that was Arabic or Farsi or whatever, but gnome-terminal rendered that horribly. :-)
<agent> works in xchat :/
<_ion> Probably.
<agent> xchat-gnome, if that makes a difference
<_ion> Probably not.
<agent> yeah, probably gnome terminal and gnome xchat do not have the same font rendering
<_ion> gnome-terminal renders combining characters as if they were normal characters.
<_ion> </offtopic>
<johnnybuoy|gento> agent, no, your fs parameters have it in them and the default is fsck every 30 mounts
<johnnybuoy|gento> you can change it with e2fstune, which is in the e2fsprogs
<johnnybuoy|gento> I can't help you more than this
<agent> johnnybuoy|gento: so there is no check at boot to see what mount # it's on (as in, if this is the 30th mount)? this is somehow built into the fs?
<johnnybuoy|gento> well, yes, fs+distro
<johnnybuoy|gento> yes
<johnnybuoy|gento> agent, it counts it
<agent> johnnybuoy|gento: yes, you can also change it with tune2fs... google search revealed that e2fstune = tune2fs... but maybe this is not accurate
<johnnybuoy|gento> but if there is a problem with it, it'll sometimes go in circle
<agent> johnnybuoy|gento: and im trying to figure out what exacting does the counting :)
<johnnybuoy|gento> agent, heh, okay, so tune2fs is the same :D
<johnnybuoy|gento> agent, I think the fs has a valuable for it
<johnnybuoy|gento> agent, ahy?
<johnnybuoy|gento> agent, why?
<agent> johnnybuoy|gento: i was wondering if it would be possible to list what mount in the cycle its on... so maybe it's possible to write some prog that catches this
<agent> err
<agent> i think i was not being clear on that second part
<johnnybuoy|gento> yes, well, I think (tun)e2fs(tune) knows ow to query this, but I'm not shure
<agent> ex: write a program that sees that it's on mount #29 and tells the user...
<johnnybuoy|gento> I did see something like this on a distro
<agent> johnnybuoy|gento: i read the man page and i actually dont see anything about it being able to do that
<johnnybuoy|gento> it said maximum number of mounts reached, fsck will be ran on next mount, you can disable this with tune2fs
<agent> johnnybuoy|gento: yes, but i dont want to disable anything :( just query to see what mount its on
<johnnybuoy|gento> okay, I dunno for the query...
<johnnybuoy|gento> but it should be an e2 (ext3) query tool, cause it's insided the fs
<agent> summary on e2fsprogs webpage: e2fsprogs, which consists of e2fsck, mke2fs, debugfs, dumpe2fs, tune2fs, and most of the other core ext2fs filesystem utilities. (notice the tune2fs - guess it was renamed)
<johnnybuoy|gento> yep
<johnnybuoy|gento> then maybe there is a third-party tool to make queryes
<johnnybuoy|gento> it shouldn't be hard to make as the specs of ext3 are completely GPL
<agent> johnnybuoy|gento: well, seeing as my programming skills are in the crapper ;)
<johnnybuoy|gento> heh
<johnnybuoy|gento> LEAVE me, I'm installing gentoo right now ;)
<agent> ok... good luck
* agent is a former gentoo'er (my first distro - back when there were no docs or automation! ;)
<johnnybuoy|gento> heh
<johnnybuoy|gento> agent, why did you change?
<agent> johnnybuoy|gento: i became tired of compiling everything
<agent> johnnybuoy|gento: also, i wanted a stable system, but not so stable like debian ;)
<agent> johnnybuoy|gento: ubuntu's 6month cycle is perfect
<johnnybuoy|gento> heh
<johnnybuoy|gento> ubuntu is nice, I like it
<johnnybuoy|gento> but my computer is too slow for it
<johnnybuoy|gento> and I wanted to test out something daunting and exciting ;P
<agent> johnnybuoy|gento: well good luck... if your pc is slow for ubuntu you will pull out your hair when you have to compile all those programs... over and over.... and over after every update ;)
<johnnybuoy|gento> heh
<agent> at least now they have binaries for big programs] 
<agent> but just so you know, speed increase is minimal
<agent> what are your specs?
<johnnybuoy|gento> agent, well, it's not that slow, but a 2yrs old ubuntu is just sooooo slow now with like 210,000 files installed
<johnnybuoy|gento> I have no time to prune everything
<johnnybuoy|gento> and it's immpossible to do a perfect job
<agent> johnnybuoy|gento: your not doing a good job with maintanance ;)
<johnnybuoy|gento> meh
<johnnybuoy|gento> 2 trs, man
<johnnybuoy|gento> 2 yrs
<agent> johnnybuoy|gento: thats always the case, regardless what distro...
<johnnybuoy|gento> any debian unstable system get's oooold after 2yrs
<agent> when was hoary released?
<johnnybuoy|gento> I used ubuntu unstable allways
<agent> yeah, thats probably not a good idea if you want to keep things clean :)
<johnnybuoy|gento> yea
<agent> johnnybuoy|gento: is there an easy way to check the amount of files on an fs?
<johnnybuoy|gento> heh
<agent> oh, and im on 2 years ubuntu (but mostly stable)
<johnnybuoy|gento> agent, for me apt told me when it was 'reading the database' for ages, then tell me I had 210,000 files installed
<johnnybuoy|gento> also, I was using kde for a while, but then switched to GNOME
<johnnybuoy|gento> now that didn't help
<agent> meh
<agent> just remove everything :)
<agent> it's actually not that difficult to revert to a "fresh install" system
<agent> just compare the "fresh install" package list with what you have and remove the extras
<agent> not counting the extra packages that you want to keep, of course ;)
<johnnybuoy|gento> hmm
<johnnybuoy|gento> right
<johnnybuoy|gento> well, I did that
<johnnybuoy|gento> but I'm pretty shure I still had some leftovers..
<agent> thats always the case, but im curious how you intend on getting gentoo to solve this?
<johnnybuoy|gento> well, it's not as a solution, more like a "I need to get some excitement" in my life
<johnnybuoy|gento> and I really do like gentoo a lot
<johnnybuoy|gento> for being able to have my own cflags and USE= flags
<johnnybuoy|gento> I mean, I know the performance benefit..
<agent> johnnybuoy|gento: yes.... if it suits you, why not? now are you planning on using a DE?
<johnnybuoy|gento> yep
<johnnybuoy|gento> GNOME
<johnnybuoy|gento> why?
<agent> just curious since you say your pc is not very fast
<johnnybuoy|gento> ah
<johnnybuoy|gento> no, it is
<agent> o
<johnnybuoy|gento> but not for 210,000 installed files
<johnnybuoy|gento> it was just crufty
<johnnybuoy|gento> I have a PentiumM centrino 1,5Ghz.
<agent> also, i dont understand how a linux system can be slow if it has many files... they are on the hd but not being used
<agent> and ubuntu for 1.5 years on 450mhz pc works fine here ;)
<johnnybuoy|gento> well, starting a program was taking ages
<johnnybuoy|gento> after that it was fine
<agent> i see
<johnnybuoy|gento> I see you really don't like gentoo
<johnnybuoy|gento> any reasons except the compile times?
<agent> i have nothing against gentoo actually
<agent> its just not for me
<agent> compile times are pretty much it...
<agent> and running find on / results in this nice number for me: 495191
<johnnybuoy|gento> heh
<agent> but that counts EVERYTHING
<johnnybuoy|gento> I have heard that btrees improve ext3 performace quite a bit, so that's what I'll use
<agent> including directories, links, and even  all those "files" in proc
<johnnybuoy|gento> agent, what does apt say about installed packages?
<agent> 1177
<johnnybuoy|gento> wtf??
<agent> no performance hit whatsoever
<agent> why?
<agent> is that a lot?
<johnnybuoy|gento> man, even on base ubuntu install it's
<johnnybuoy|gento> 80,000
<agent> no
<agent> you asked for # of packages
<agent> not files ;)
<johnnybuoy|gento> ah, right
<johnnybuoy|gento> sorry
<agent> hehe
<johnnybuoy|gento> I meant files
<johnnybuoy|gento> when apt (dpkg) says reading the database
<agent> its too fast
<johnnybuoy|gento> then it spits out some files
<johnnybuoy|gento> meh
<agent> :D
<agent> and this is on a 1ghz laptop
<agent> what command do you pass to get the # of file
<agent> i see nothing about files, just packages
<agent> maybe its just too fast
<johnnybuoy|gento> hmm
<johnnybuoy|gento> nope
<johnnybuoy|gento> just reinstall a package, it'll read that database every time
<agent> your right!
<agent> never noticed that before
<agent> hah
<agent> 100498 files and directories currently installed
<johnnybuoy|gento> see
<johnnybuoy|gento> I had twice as many
<agent> :)
<johnnybuoy|gento> dunno, tho
<agent> you don't clean your system!
<johnnybuoy|gento> yes I do
<johnnybuoy|gento> I'd like to use upstart
<agent> well, 100,000 packages says you dont ;P
<agent> err
<agent> files
<agent> not packages
<agent> haha
<johnnybuoy|gento> it's a nice project, would be nice if gentoo didn't have that initng cr*p
<agent> oh and one more thing i like about ubuntu: it just works (well, except multimedia)
<johnnybuoy|gento> heh, 100,000 packages would be a world record, I guess
<agent> there are only 20,000 in ubuntu repos
<johnnybuoy|gento> agent, yea, I know, but still, if gentoo is configured properly it just works also, and better
<johnnybuoy|gento> s/better/faster
<agent> johnnybuoy|gento: aye :)
<johnnybuoy|gento> :)
<agent> oh... i found out how to check inodes
<agent> df -i
<agent> that will quickly show you amount of files, directories, etc. together
<johnnybuoy|gento> yea! ext3 is nice
<johnnybuoy|gento> I wonder what they'll do for ext4
<johnnybuoy|gento> ...
<agent> in gentoo i switched from ext3 to reiserfs :)
<johnnybuoy|gento> wel, that's highly unsafe...
<agent> what?
<agent> reiserfs?
<johnnybuoy|gento> in this install I wanted to use reiser4, but I think I'll just use ext3 with btrees
<johnnybuoy|gento> yes, reiser4
<johnnybuoy|gento> and reiserfs
<agent> reiser4 != reiserfs
<agent> o
<agent> :)
<johnnybuoy|gento> both are rather unstable
<agent> worked for me
<johnnybuoy|gento> also, do you know about Mr. Hans Reiser?
<agent> i know who he is, yes.... i dont know much about him
<johnnybuoy|gento> http://en.wikipedia.org/wiki/Hans_reiser#Arrest_following_wife.27s_disappearance
<agent> i guess reiser4 wont be stable soon, eh?
<johnnybuoy|gento> heh
<johnnybuoy|gento> probably not heh
<johnnybuoy|gento> tho some project might pick it up
<johnnybuoy|gento> it's a quite nice design
<rmjb> Hi
<rmjb> does udev trigger an event when it starts in edgy?
<rmjb> can I create an upstart script that runs "on udev-start"?
#upstart 2006-10-24
!christel:*! Hi all. We seem to have been affected by a small networking glitch at one of our uplinks. Affected users were about 4,000. All seems back to normal now. Thank you for using freenode and have a great day!
<dr-evil> hi all, how to change a codepage
<dr-evil> to a koi8-r
#upstart 2006-10-25
<tapas> hi
<Keybuk> heh
<Keybuk> I thought people used IRC bouncers to avoid disconnecting from IRC :p
<thom> they're called bouncers for a reason :P
<Keybuk> BOUNCY! BOUNCY! BOUNCY! BOUNCY!
#upstart 2006-10-26
* Signon time  :    Thu Sep 21 08:57:04 2006
* Signoff time :    Thu Oct 26 06:50:09 2006
* Total uptime :   34d 21h 53m  5s
* Starting logfile irclogs/upstart.log
-ChanServ(ChanServ@services.)- [#ubuntu-server]  Ubuntu Server Discussions (development and support)
-ChanServ(ChanServ@services.)- [#ubuntu]  Welcome to #ubuntu! Please read the channel topic and consider spending some time on the FAQ mentioned there
<WorkRoey> hi :)
<WorkRoey> does upstart enable parallelizable booting?
<WorkRoey> (and shutting down/restarting)
<Md> yes
<WorkRoey> cool.
<WorkRoey> I hope it speeds up booting significantly...
<WorkRoey> and that Debian Proper accepts it.
<phsdv> Hi all. Did anyone mannage to get upstart running on a non-ubuntu machine?
<phsdv> My machine does boot but errors on the scripts in /etc/event.d
<Roey> anyone here know how much time upstart's parallelized booting shaves off of Ubuntu's booting time?
<_ion> Ubuntu still uses sysv-rc via the upstart compatibility layer.
<Roey> oh....erg.
<Roey> so there are plans to move completely to upstart?
<_ion> The next release, probably.
<Roey> neat, ok.
<Roey> thjanks
<concept10> I really need help.  I installed upstart on my Edgy install and it will not boot.  it loads kernel only and says it has no more jobs.
<concept10> Suggestions to start debugging this?
<concept10> anyone around?
<concept10> anyone around?
<concept10> is there a way to manually get upstart to boot my system from the CLI?
<concept10> I installed upstart on my system without any jobs, any suggestions on how to get the jobs on my system?  After reading, I found out that I do not have the upstart-compat-sysv package installed.
<_ion> Don't you have the ubuntu-minimal package installed? It depends on every necessary package.
<concept10> I am not sure about that package
<concept10> but my Edgy install was working before I installed upstart
<mbiebl> Install upstart-compat-sysv and you should be fine.
<concept10> Problem now is that I cant boot into my system.  Meaning no networking
<_ion> Boot with init=/bin/bash
<_ion> Install ubuntu-minimal and ubuntu-standard
<concept10> _ion: you mean from where?
<concept10> grub?
<_ion> The installer should have installed them in the first place.
<_ion> Yes.
<mbiebl> Boot, then run /etc/init/rcS && /etc/init/rc 2
<_ion> init.d
<concept10> Okay, let me get this right, because right now I have to boot into windows to get onto the net
<_ion> After running rcS and rc 2 you should have networking.
<mbiebl> Yeah
<concept10> next problem: installing upstart got rid of sysvinit
<concept10> (removed)
<mbiebl> thats intentional ;-)
<concept10> I understand that
<concept10> so /etc/init/rcS should be still there?
<_ion> Yes.
<rgl_> hi
<mbiebl> dpkg -S /etc/init.d/rcS tells you that it is part of the sysv-rc package
<concept10> so right now there are only two upstart jobs, which are ctrl-alt-delete and sulogin.  from there I should be able to run /etc/init.d/ scripts I assume
<concept10> and then I need to get the upstart-compat-sysv package
<_ion> Really, install ubuntu-minimal and ubuntu-standard, or your system breaks the next time something big changes. :-)
<mbiebl> Do, as I told you, boot your ubuntu box, login, run /etc/init.d/rcS, /etc/init.d/rc 2 and then install upstart-compat-sysv
<concept10> alright, i will make sure to install those als
<concept10> alright, thanks guys
<concept10> I dont know why those meta-packages get removed
<concept10> thanks for the help, hopefully I get back into the system and i will come back with the beer
<rgl_> how do I disable a service like tty2?
<rgl_> the only way is to manually edit the event.d/tty2 file and comment all "start on" lines?
<rgl_> http://upstart.ubuntu.com/download/example-jobs.tar.gz is 404 :|
<concept10> thanks guys, running those scripts got me back into the system
<debugger> what should I do to known what is causing "status: Error receiving message: Invalid message received" when I run "status logd"?
<mbiebl> rgl, http://upstart.ubuntu.com/download/example-jobs-2.tar.gz
<rgl> mbiebl, ah thx!  thou, those sripts seem to be the same that are included with edgy hehe
#upstart 2006-10-27
[chaoticg33k(n=chaoticg@alphabox.cxw.utoledo.edu)]  hello
<jme> I suppose this is the wrong place to ask re Usplash configuration
<oneman> my upstart jobs in edgy are not starting on startup..
<oneman> it works with start and stop
<oneman> i also notice it doesn't work with daemons that fork off and become a session leader..
<_ion> Add something like 'start on runlevel-2'
<_ion> Add 'daemon' for a forking daemon.
<oneman> ive got start on startup :P
<oneman> where do i put daemon, just anywhere?
<_ion> "start on startup" means that it's started before filesystems have been checked, or networking has been started, or syslogd has been started etc.
<_ion> Yes.
<_ion> I'd put it just before or after the 'exec foo' or 'respawn foo' line, or just before the 'script' block.
<oneman> ohh
<oneman> ok, for lighttpd
<oneman> daemon worked for starting, but it doesn't kill it on stop
<oneman> upstart is cool
<oneman> but its apha betaboy stuff
<oneman> and you have to go talk to the developers themselfs on internet chat to get them to tell you secret undocumented information to really do anything
<H__2> anyone awake ?
<Keybuk> yup
<Keybuk> what's up?
<H__2> i have a question about the new developments : the job-starting and such. Is the following planned : when service A requires service B, and B is restarted, is then A stopped before B stops and A started after B started again ?
<Keybuk> it depends
<H__2> ;-)
<Keybuk> if A wants to be restarted when B is restarted, it would indicate as such in its job definition
<Keybuk> e.g.
<Keybuk> stop on job-stopped B
<Keybuk> start on job-started B
<H__2> ok, does "stop on job-stopped B" mean that A stops after B stopped ?
<Keybuk> no
<Keybuk> it means B stops because A is
<H__2> Can't follow you there. This is the scenario : A requires B. B is restarted, the question is what happens to A, and in what order
<Keybuk> B is stopped
<Keybuk> A is stopped
<Keybuk> B is started
<Keybuk> A is started
<Keybuk> with that example
<H__2> exactly, so  A stops after B stopped. I think that is wrong.
<Keybuk> if you needed it in the other order, you'd use "stop on job-pre-stop B" or similar
<Keybuk> upstart doesn't enforce any of this, it simply issues sufficient events for you to define the behaviour
<H__2> ah, perfect :)
<H__2> very interesting
<H__2> another small question : from the website "being developed for the Ubuntu distribution" does that mean that Ubuntu now actively uses it, or that it is targetted to replacing the system currently present in ubuntu ?
<thom> H__2: ubuntu now uses it
<H__2> nice, thanks. Will look into it.
<Keybuk> (as of the release of edgy, yesterday)
<H__2> is there a way in upstart to draw a dependency graph of a bunch of scripts that subscribed to upstart's events ?
<Keybuk> there may be eventually, yes
<Keybuk> I think that such a thing would be useful
<H__2> heh :) I've been drawing those by hand and sometimes using graphviz ;-)
* Keybuk uses graphviz
<Keybuk> I figured upstart would output dotty
<H__2> the example jobs from the homepage (http://upstart.ubuntu.com/download/example-jobs-2.tar.gz) don't have "job-pre-stop"-level rules, is there a second list of examples available for download perhaps ?
<Keybuk> job-pre-stop rules don't exist yet
<Keybuk> upstart's still in heavy development
<Keybuk> they're planned for the 0.3 series
<H__2> ow ;-)
<H__2> I got the impression from your ' you'd use "stop on job-pre-stop B" ' that it was already available ;-)
<Keybuk> you'd use "stop on B/stopping" at the moment
<Keybuk> (and "start on B/starting")
<Keybuk> they mean about the same thing
<H__2> well, it's a race we suffer from at the moment. So we still must use our proprietary solution
<H__2> another question : is the event queue re-read and any new (or removed) subscriber results merged with the active queue after any upstart action ?
<Keybuk> not sure I understand the question>?
<H__2> ok, i'll make up an axample :
<H__2> let's say that upstart is active and it as to start scripts A, B, C and D (in that order). And it just finished starting B. This script B has enabled another event script called X. The dependency order of X is that it has to start before C. What does upstart do ?
<Keybuk> upstart doesn't have dependency orders
<Keybuk> it's not a dependency-based init system
<Keybuk> it would be better if you phrased your question in terms of a real example
<H__2> well, it is actually a real example, but from a proprietary system I wrote
<Keybuk> ok
<Keybuk> so you have four jobs, A, B, C and D
<H__2> yes
<Keybuk> B starts on job-started A, C starts on job-started B, D starts on job-started C
<H__2> yes
<Keybuk> what do you mean by "enabled another event script" ?
<H__2> Let's say that script B wrote a script X (or copied it into place), and if available then C wants X to have started before C itself starts.
<Keybuk> so C should be started by the "X started" event
<Keybuk> not the one for B
<H__2> the C - B relationship is not changed, there is a new one inserted halfway
<H__2> and indeed, 'C should be started by the "X started" event'.
<Keybuk> you're confusing relationships and events
<Keybuk> upstart isn't a dependency-based init system ;)
<Keybuk> it doesn't have relationships
<H__2> possibly, i'm new to upstart terminology
<Keybuk> it takes a little bit of a backstep to understand how to translate dependency-based information into event-base
<Keybuk> they're not a 1:1 mapping by any means, and are quite different
<Keybuk> we're convinced event-based is better
<Keybuk> but it does mean that if you come from init-ng, gentoo, etc. you can't just run some perl/sed over the init script to get an upstart one -- you have to rethink how the service is started
<Keybuk> and how multiple jobs interact (rather than depend)
<H__2> ok
<H__2> (I don't come from  init-ng, gentoo, etc, it's my proprietary development. And I'm wondering whether it can be replaced)
<Keybuk> so the basic theory of upstart is not that services depend or require one another
<H__2> so far upstart comes closest :)
<Keybuk> but that services are started because other things happen
<Keybuk> this is because in reality most things don't depend on another service, but an abstract concept
<Keybuk> e.g. "on battery power"
<H__2> well
<H__2> what we have is fi. a script that creates an tunnel device, to which other services want to bind. I call that a dependency.
<Keybuk> right
<Keybuk> so the obvious change there is
<Keybuk> other services do not depend on a script that creates a tunnel device
<H__2> and if this tunnel device disappears, then the others are in trouble, they must be stopped upfront
<Keybuk> instead, other services need the tunnel device!
<Keybuk> so in upstart, you'd do "on network-device-added tun0"
<Keybuk> and make sure udev sent that event to it
<Keybuk> that way the services come up with the tunnel
<Keybuk> likewise, you'd stop them because the tunnel device went away
<Keybuk> which means even if the user ifconfig'd it down, the services would stop
<H__2> went away is too late ;-) will go away is what we need
<Keybuk> there's no way to know it "will go away"
<Keybuk> ifconfig tun0 down
<Keybuk> *boom*
<Keybuk> you can have a "bring tunnel down safely" script
<Keybuk> that can issue a "going to take tunnel down" event which stops the services
<Keybuk> but they should also be stopped if the tunnel goes away unexpectedly
<H__2> yes the 'die unexpectedly' is a different problem
<Keybuk> we think it's the same one
<H__2> interesting :)
<Keybuk> so how I'd do that would be have
<Keybuk> /sbin/remove-tunnel which is a script that does
<Keybuk> initctl emit network-device-going-down tun0
<Keybuk> ifconfig tun0 down
<Keybuk> --
<Keybuk> and then have the services include both
<Keybuk> stop on network-device-going-down tun0
<Keybuk> stop on network-device-down tun0
<Keybuk> --
<Keybuk> that way your services can safely come down if the script is used
<Keybuk> but also come down if the script isn't used
<Keybuk> one should try one's best to have the services at least deal with that sanely, where sane can include logging an error in syslog
<hunger> Keybuk: Did you upstartify ifup/ifdown?
<Keybuk> hunger: not yet, https://launchpad.net/distros/ubuntu/+spec/replacement-network-events
<H__2> the " have the services at least deal with that sanely" is indeed what we want, sadly that piece of software is out of our control :-/
* hunger is looking forward to seeing upstart develop in feisty.
<hunger> Is there a timeline for upstart in feisty yet?
<H__2> why don't you call the " stop on network-device-going-down tun0" a dependency ? to me that is a fine example of a dependency
<Keybuk> hunger: what kind of timeline?
<Keybuk> H__2: because dependency infers in people's mind certain semantics; which don't exist in this case.  "network-device-going-down" is an event, it's something that happens
<hunger> Keybuk: Like what is planned for when. On second thought I guess that will be in the specs once they become available.
<Keybuk> hunger: the specs are already registered, just not yet written
<hunger> Keybuk: I noticed:-)
<hunger> I think I'll need to spend some time hacking my cryptdisk setup into your scripts when those hit the repositories.
<H__2> heh :) and if others want to be notified of such events you still don't call that a dependency ? A subscription then perhaps ?
<Keybuk> H__2: the particular case is "start on foo"
<Keybuk> if bar depends on foo, people assume that even if bar is created after foo has been started, bar will be started
<Keybuk> whereas when "foo" is an event, people realise that it's forgotten about once it happens
<H__2> I don't get this "if bar depends on foo, people assume that even if bar is created after foo has been started, bar will be started" If bar depends on foo, then bar cannot be started if foo's not there. But if foo is there then bar can start.
<Keybuk> yes
<Keybuk> exactly
<Keybuk> that's what dependency infers
<Keybuk> which is why we don't use that term for upstart
<Keybuk> bar can be started manually at any time
<Keybuk> it's up to bar to decide whether it should fail to start because foo is not running
<H__2> in my world it can not
<H__2> but I think I see what you mean
<Keybuk> unfortunately, without you elaborating on what your world is, I can't understand
<Keybuk> if a service depends on a tunnel device, and that tunnel device is not present when it is started, /it should fail anyway!/
<Keybuk> and it should present a useful error message to debug that failure
<H__2> it should not even try to start, controlled by the service trying to start it
<Keybuk> why not?
<Keybuk> the sysadmin should always be able to get their hands dirty and try things
<H__2> because we know it will fail
<Keybuk> you don't know it will fail
<Keybuk> the sysadmin may have created the tunnel by hand
<H__2> true, interesting. Let's say "there is no sysadmin". these are embedded systems.
<Keybuk> then you don't need to worry about this scenario, because it's inherently not possible ;)
<Keybuk> if you have no tinkering sysadmin, then you can ignore it
<H__2> I think you lost the plot :)
<Keybuk> ?
<Keybuk> I haven't been told the plot
<H__2> I'll try to describe it better
<H__2> that turns out to be quite hard. I'm not sure what to add to it what would help us.
<Keybuk> you're saying that "bar should not be able to start if foo isn't running"
<Keybuk> but I'm saying that if the only thing that can start bar is the init daemon, then you don't need to worry about that eventuality
<Keybuk> nothing will try to start bar except the init daemon, as a result of the events that are listed as causing it to start
<H__2> maybe this : if A has a "start on" subscription to B, and upstart just tried to start B, but B failed, does upstart then continue starting A ?
<Keybuk> depends on the event subscribed to
<Keybuk> if the event is the started one, then no
<Keybuk> if it's the starting one, then yes
<H__2> ok, clear :)
<Keybuk> sorry that it seems a little confusing, it's much easier to demonstrate with examples
<H__2> Can you elaborate a bit more on the "A has a dependency on B" versus "A is subscribed to an event of B" difference you make ?
<Keybuk> upstart issues events as B changes state
<Keybuk> e.g. job-starting, job-started, job-failed, job-stopping, job-stopped, etc.
<Keybuk> if A is subscribed to any of those events, then it will be started or stopped if an event occurs
<Keybuk> events are one-shot things, they are emitted, get handled by changing the state of any subscribed job, and then get forgotten about
<Keybuk> they can be emitted by any part of the system
<Keybuk> as well as job-started, you can also have network-device-added, block-device-added, path-mounted, battery-power, etc.
<H__2> Ok, that part is clear. The question is why it is not considered to be a dependency. The end result in bout our systems is the same btw :)
<H__2> bout->both
<Keybuk> the word dependency conjours up certain things in people's minds
<Keybuk> if I say that "foo depends on bar", then I would assume certain things:
<Keybuk> - bar is started if I try and start foo
<Keybuk> - if bar fails to start, foo does not start
<Keybuk> - if bar is already running when I try and start foo, then foo is started
<Keybuk> - if foo stops, and nothing else depends on bar, bar is stopped
<Keybuk> - bar cannot be started if foo doesn't exist (or is disabled)
<H__2> don't agree with " - if foo stops, and nothing else depends on bar, bar is stopped", and the one after it too, the rest: yes
<Keybuk> while all of these things can be replicated in upstart with a combination of events, simply adding "start on job-started bar" does *not*
<Keybuk> H__2: dependency-based init systems do that
<H__2> only if they are bi-directional dependencies IMO
<H__2> bar doesn't care if there's a foo that wants to use it, so if foo is stopped, bar doesn't care
<Keybuk> but that's not what a dependency-based init system does
<Keybuk> so calling events dependencies, in an init system, would confuse people
<H__2> ah, that's then where our confusion comes from. It is what a dependency-based init system does in our opinion (see Gentoo for example).
<H__2> dependencies have only one direction.
<H__2> a system with bi-directional dependencies cannot start :)
<Keybuk> I'm completely unfamilar with Gentoo's, I'm afraid
<Keybuk> the way that initNG and SMF work is to start a set of goal services, which cause their dependencies to start, et. al. down the list
<Keybuk> if you stop a goal service, than any dependencies unused by anything else are also stopped
<Keybuk> this is consistent with dependencies in the package manager as well
<H__2> I'm unfamiliar with  initNG and SMF :)
<H__2> I would say " up the list" instead of " down the list" in 2 lines up
<Keybuk> also to me, depends infers state tracking
<Keybuk> "bar depends on network-device tun0"
<Keybuk> which implies that the state of that network device is tracked
<Keybuk> upstart relies on something else to track the state, and issue the events when it changes
<H__2> ideally yes
<Keybuk> so instead
<Keybuk> "start bar on network-device-added tun0"
<Keybuk> "stop bar on network-device-removed tun0"
<Keybuk> type thing
<H__2> clear
<H__2> in our system the tracking is present, but handled outside the 'upstart' alternative. By using blunt checkscripts :)
<H__2> can only do polling from scripts there, in most cases.
<Keybuk> upstart is intended to be useful where you have events from other systems
<Keybuk> and don't need to poll
<Keybuk> e.g. udev for hardware
<H__2> clear
<hunger> Keybuk: I like the heartbeat idea that came up on the -devel ML.
<hunger> Keybuk: That would absolutely rock for the server crowd.
* H__2 hides his heartbeat system
<H__2> ;-)
<H__2> just joking, besides they're probably different anyway
<Keybuk> hunger: without knowing much about heartbeat, I couldn't comment much
<hunger> Keybuk: heartbeat is pretty simple: basically it is just doing something when the heartbeat is no longer heared.
<H__2> from where to where is this heartbeat communicated ? what does it monitor ?
<hunger> Keybuk: I only ever used something like that on AIX, so I can not comment on how linux works either.
<hunger> H__2: heartbeat is used for eg. when you want a highly available webserver. You set up two that send each other heartbeat signals.
<H__2> ok, so 'total service' is monitored
<H__2> then it's the same as what we have
<hunger> H__2: When the hearbeat of the master is no longer heared by the slave that takes over IPs and stuff and continues.
<H__2> clear
<Keybuk> you could have heartbeat emit a "flatline" event ;)
<Keybuk> and then write upstart jobs with "on flatline"
<hunger> Keybuk: Yes, exactly.
<H__2> ack
<Keybuk> it's a definite goal to get rid of everything's *.d script directories
<H__2> btw, FreeBSD now has a similar dependency system in their init scripts (as what I talked about earlier)
<H__2> with complaints like : % rcorder: requirement `named' in file `/usr/local/etc/rc.d/samba.sh' has no pro
<H__2> viders.
<H__2> nice to see the world moving in the same direction :)
<Keybuk> right, but bear in mind that upstart doesn't do that ;P  it's not a dependency-based init system
<Keybuk> in an upstart system, samba instead would be started by an event such as "dns-available"
<H__2> and a lot more I hope
<Keybuk> and that event could be emitted by either the bind9 job, a dhclient job or a network interface job if it detects an available IP in /etc/resolv.conf
<hunger> Keybuk: That is the one weakness I see in upstart: It will be a PITA to figure out on which events to react, there being so many of them.
<H__2> hey, if I understand right the need for 2 providors is also not present in upstart, like samba starts on 'dns-available' but samba also needs 'eth0 available' which may not be there yet, so samba would get started another time lateron when 'eth0' appears, right ?
<hunger> Keybuk: And that some things will end up depending on more than one event will make things even worse.
<Keybuk> H__2: not currently, methods of doing that are being discussed and will be in 1.0
<H__2> and will still not be called dependencies, right ? ;-) (sorry , couldn't resist)
<hunger> H__2: ... and all-exported-filesystems-available is another candidate ...
<H__2> I'll get some coffee now
<Keybuk> it depends on the semantics
<Keybuk> we've talked about the idea of having jobs "wait" for an event
<Keybuk> so one might do:
<Keybuk> start on foo
<Keybuk> wait for network-device-added eth0
<Keybuk> wait for dns-available
<Keybuk> --
<Keybuk> does this mean that dns-available has to occur *after* foo
<Keybuk> or does this mean that dns-available just has to occur at any point on the system
<hunger> Keybuk: Will that work if dns-available happens before foo?
<Keybuk> hunger: exactly
<hunger> Keybuk: I have thought about how to integrate my cryptsetup script with upstart.
<Keybuk> and how does that work if the network device comes back down again?
<hunger> Keybuk: In addition to what the normal one shipped with ubuntu can do mine can mount a FS, read keys from there, mount other FSes and then unmount the key-FS again.
<Keybuk> the network-device-added event happened, so that "wait" has been fulfilled
<hunger> So basically I would need to make sure that the key-FS is setup and mounted before any FS it contains a key for and then unmount it again once all of them are up. No idea how I can express that in events.
<Keybuk> why unmount the key FS?
<hunger> Keybuk: So that nobody can get the keys once the system is up.
<Keybuk> they could just mount it? :p
<hunger> Keybuk: I unmount the FS and destruct its decrypted device. That way only the encrypted device is visible once the other crypted FSes are up.
<H__2> I'll ask for open-source clearance once more, i'm very interested in what you have to say about it
<hunger> all that happens before the network comes up, so I am pretty sure nobody can steal my keys;-)
<H__2> only the tempest crew in the other building :-P
<hunger> H__2: upstart breaks the displaying of the password prompt... that might confuse those guys;-)
<H__2> Keybuk : is there an advanced examples tar ball ?
<H__2> hunger: heh :o)
<Keybuk> H__2: no
<Keybuk> hunger: I don't understand why
<H__2> ok, then maybe in Ubuntu 6.10 ?
<hunger> edgy is screwed up wrt. displaying startup info anyway... running usplash gives the password prompt and displays the password which is even worse IMHO.
<Keybuk> 6.10 was released yesterday
<Keybuk> hunger: "screwed up" ?
<H__2> i know it was released yesterday, I meant to ask whether it did contain more advanced stuff than the examples tar ball
<Keybuk> no, the examples tar ball is the copy of the jobs from ubuntu 6.10
<H__2> aah, ok :)
<hunger> Keybuk: Without usplash: no password prompt, with usplash: password prompt is displayed but password is echoed to the screen.
<hunger> Both is not really the way I expected it to be;-)
<H__2> Thanks for the chat. (I'm off for a lunch-walk now.)
<phsdv> hi all, I just managed to get my gentoo system booted using upstart.
<phsdv> but I am getting some errors like: control-alt-delete: init: /dev/initctl: No such file or directory
<phsdv> does someone know how to fix that?
#upstart 2006-10-28
<astronouth7303> what is the correct way of starting a task (specified by respawn) with arguments?
<astronouth7303> just put them in the respawn line?
<_ion> respawn program arg0 arg1
<_ion> is an alias for
<_ion> exec program arg0 arg1
<_ion> respawn
<_ion> IIRC. :-)
<astronouth7303> and what would be the correct way to tell upstart to start the command as a different user?
<astronouth7303> place su in the start script?
<_ion> Unless i remember wrong, upstart doesn't yet support that directly  you might use e.g. "exec start-stop-daemon ... --chuid foo:bar program -- arg0 arg1"
<astronouth7303> ug
<astronouth7303> how many deamons have upstart files?
<cortana> the problem with start-stop-daemon is that it does not create a PAM session, so things like libpam-tmpdir will break the daemon
<Solaris> hi fellas.
<Solaris> I was wondering what kind of boot time improvement upstart gives.
<Solaris> How much are we talking?
<Solaris> 50% reduction? 10% reduction?
<_ion> Ask again when we have reached the state where an OS is booted entirely by upstart jobs. :-)
<_ion> The point of upstart isn't boot time improvement, although that may be a side effect because of parallel startup etc.
<Solaris> Ah i see _ion
<Solaris> I just noticed ubuntu is busy telling everyone.
<Solaris> So I figured I would ask after them.
<_ion> The latest Ubuntu release is still using upstart's sysv compatibility layer. The next release's boot process might be completely based on upstart.
<Solaris> interesting.  So what IS the main goal of upstart?
<_ion> See http://www.netsplit.com/blog/articles/2006/08/26/upstart-in-universe , title "Why change it?"
<_ion> That page, as well as other interesting pages, are linked from http://upstart.ubuntu.com/ (which is in the topic).
<Solaris> thanks
<Solaris> Oh right.  Yes, I see the problem.  When you look at it that way something really does need to be done.
<_ion> cortana: I believe upstart is going to support PAM sessions for stuff started as a non-root user in the future.
<cortana> yay
<_ion>  * Per-user services; will need to use PAM to set up the session.
<_ion>    We want to do this for "root-user services" but not for jobs/tasks
<_ion> (from TODO)
<Solaris> So how long until you have something that would make a stable, complete replacement for the init system?
<_ion> That would probably be possible right now (assuming you mean init plus the startup scripts), but there are some planned design changes that are going to be implemented before that effort.
<Solaris> right right.
<Solaris> Well, looking forward to seeing it.
<Solaris> Do you know which distros are going to adopt your system?
<_ion> (Disclaimer: i'm mostly a enthusiastic bystander, Keybuk has done pretty much all the actual work.)
<_ion> AFAIK many distros have shown interest, but probably no distribution is going to make the decision before Ubuntu's startup is running entirely based on upstart.
<Solaris> haha!
<Solaris> fair enough at this point I suppose.
<Solaris> Gotta love the cross-polination possible with open-source.
<trivash> ok can someone answer a question for me?
<_ion> That would be quite difficult, because you left.
#upstart 2006-10-29
<twb> AFAICT the 6.10 desktop livecd does not take advantage of upstart's asynchronous starting facility, because everything (except what used to be inittab) is still started via /etc/init.d/rc.  Is this correct?
<Amaranth> Yes.
<twb> Will upstart continue to depend on upstart-compat-sysv?  If so, can a package maintainer provide init scripts for both sysvinit (i.e. Debian) and upstart?  Would it require separate packages for Ubuntu and Debian?
<Amaranth> You've passed my limit of knowledge of upstart :P
<Amaranth> I usually just idle here to watch the smart people talking
<twb> It's more an infrastructure thing.
<twb> I mean, there's a mechanism in place to make upstart start the sysvinit config files.
<twb> That means that a package can't just provide a file in init.d and a file in event.d, because then the daemon will be started TWICE.
<twb> (Am I making sense?)
<Amaranth> yeah
<Amaranth> i suggest filing a bug :)
<twb> I'm allergic to the Ubuntu bug tracker :-(
<_auke> errm.. hi?
<_auke> can I bug anyone here with a tex-related question about the upstart-specification-pfd?
<_auke> *pdf
<psypointer> hi
-ChanServ(ChanServ@services.)- [#ubuntu-server]  Ubuntu Server Discussions (development and support)
-ChanServ(ChanServ@services.)- [#ubuntu]  Welcome to #ubuntu! Please read the channel topic and consider spending some time on the FAQ mentioned there
<keen123456> i need to connet to a node
<keen123456> pasted my reference at http://dark-code.bulix.org
<keen123456> what happens now?
<keen123456> #australia
#upstart 2007-10-25
<Clinton__> devel only channel?  Or can I ask a question on the proper way to get a script to be dependent upon networking?
<Jc2k> pff
<Jc2k> patience luke
#upstart 2007-10-27
<ion_> #define mygl_begin(mode) { for (int _mybl_begin_i = 0; _mybl_begin_i < 3; ++_mybl_begin_i) if (_mybl_begin_i == 0) glBegin (mode); else if (_mybl_begin_i == 2) glEnd (); else
<ion_> mygl_begin (GL_TRIANGLES) { glVertex3f ... }
<ion_> Thanks to libnih for inspiration.
<ion_> +typos
<Arafangion> Howdy guys, I'm using upstart for my (custom) distro, without sysv init. :)
<Arafangion> Just wondering what are the common styles of handling 'shutdown' scripts are.
<Arafangion> For now, I've just got an 'onshutdown' job that is fired when recieving the 'shutdown' event, which contains a script that calls initctl a dozen times to stop a dozen other jobs that were started, but there has to be a better way.
<AlexExtreme> I have a 'shutdown' job which does the proper shutdown (unmount filesystems, reboot/shutdown), which is started on the shutdown event
<AlexExtreme> then, put this in the jobs you want to stop at shutdown: "stop on starting shutdown"
<Arafangion> AlexExtreme: I'd rather not have to do the tasks sequentially. :(
<AlexExtreme> you don't have to
<AlexExtreme> http://ftp.frugalware.org/pub/other/upstart-jobs/upstart-jobs/jobs.d/shutdown
<Arafangion> Seems that if I want concurrent, I really need a dozen jobs, all which listen to the shutdown event, and a final 'halt' script that is run after all of those are stopped.
<Arafangion> Hmm.
<Arafangion> Ahh, I'm not using runlevels.
<AlexExtreme> the runlevels in that script are only used to determine whether to shutdown or reboot
<Arafangion> But I'll model something on that.
<Arafangion> Yeah, looks fairly generic, now that I actually read it.
<AlexExtreme> all the jobs that need to stop at shutdown have "stop on starting shutdown"
<Arafangion> What's all the "killall5" commands?
<Arafangion> Not familiar with that.
<Arafangion> In what way is it different to 'killall'?
<AlexExtreme> not exactly sure, it's provided by sysvinit, I just used it because the scripts I ported used it
<Arafangion> I don't have sysvinit. :)  Anyway, thanks for that script, I'll do something very similar.
<Arafangion> What would be very nice, though, would be to have an ability to do something like:
<Arafangion> start on no-jobs-starting-after shutdown
<Arafangion> Where that job will start after everything else that has started in response to shutdown has finished.
<Arafangion> And one can then just add small scripts for particular services, such as databases, etc, which might take more than 2 seconds to finish.
#upstart 2007-10-28
<Arafangion> Hey guys, how do I send an event whenever my eth0 becomes up?
<Keybuk> hello
<Keybuk> Arafangion: initctl emit
<Keybuk> (simple answer)
<Arafangion> Keybuk: yes, where exactly do I put that?
<Arafangion> My networking job does '/sbin/ip link set eth0 up', but it is only some time later that eth0 actually becomes up.
<Keybuk> Arafangion: I cannot answer that question without detailed knowledge of how your distro of choice manages its network interfaces
<Arafangion> Keybuk: It's custom, without sysv compatibility.
<Keybuk> then only you can answer that question
<Keybuk> you might have something like Network Manager
<Keybuk> or at least HAL or udev
<Arafangion> Keybuk: I have udev, I have yet to install HAL.
<Arafangion> Do I need HAL?
<Keybuk> udev would tell you when the interface comes UP
<Arafangion> Would udev be able to send the event?
<Keybuk> that wouldn't tell you whether it was configured or not
<Keybuk> only something like Network Manager could tell you that
<Arafangion> Hmm, so I'd pretty well need to setup HAL, and write a custom script to manage that?
<Arafangion> For now, I suppose I'll have to make do with a sleep 2 in the networking script.
<Keybuk> a Utopian Upstart install would look something like:
<Keybuk>   Upstart as init
<Keybuk>   D-BUS for IPC
<Keybuk>   udev for kernel user-space management
<Keybuk>   HAL for application management
<Keybuk>   Network Manager dealing with network interfaces
<Keybuk>   GNOME Power Manager dealing with ACPI/APM
<Arafangion> I'll be doing something very similar. :)
<Keybuk> we haven't figured out all the bits yet
<Arafangion> Must be why the documentation is a bit sparse in some places. :)
<Keybuk> exactly
<Keybuk> Upstart 0.3 is, at best, a technology prototype/demo
<Arafangion> I'm using upstart 0.3.8, with the install slightly patched to prevent broken symlinks.
<Keybuk> 0.3.9 fixes that, no?
<Arafangion> Hopefully. ;)
<Arafangion> But it wasn't fixed in 0.3.8, which was the version that was up-to-date when I tried it. :)
<Keybuk> you're using program-prefix/suffix/transform and the symlinks aren't transformed
<Arafangion> What?
<Keybuk> ?
<Arafangion> No, just two symbolic links that deal with sysv compatibility was created regardless of sysv compatibility being enabled or not.
<Arafangion> A minor thing, really.
<Keybuk> oh
<Keybuk> I think that's fixed in 0.3.9 too
<Keybuk> yes
<Arafangion> Cool. :)
<Arafangion> Maybe in a few months, I'll backup and check out the latest version of upstart. :)
<Arafangion> I'm aiming to have a /very/ nice boot sequence.
<Arafangion> (It's a laptop)
<Arafangion> My major fault with upstart so far is the diagnostics are a bit... raw.
<Arafangion> If I add a new job to /etc/events.d, it complains about 'init: //etc/event.d/foo: unable to read: Invalid argument', without really giving me much more info.
<Arafangion> Also seems to refer to a mythical /etc/event.d/4913, as well.
<Keybuk> vim
<Keybuk> it always makes a file called 4913 in whatever directory you're editing files
<Keybuk> so Upstart thinks it's a job
<Keybuk> and what other info do you expect there?
<Keybuk> That's all the info Upstart *has*
<Keybuk> it tried to read a file, and it got EINVAL
<Keybuk> though that's a bug :)
<Keybuk>        EINVAL (since Linux 2.6.12), length was 0.
<Keybuk> you should file that <g>
<Arafangion> Heh. :)
<Arafangion> I may be a dev, but I'm a *user* here. ;)
<Arafangion> Still, it's complaining about /two/ files, really.
<Arafangion> Perhaps a fix would be an upedit command, which makes a copy of the job in /tmp, then edits it with the preferred editor.
<Keybuk> or just don't use vim :)
<Arafangion> DIE!
<Keybuk> it's not really an issue
<Keybuk> since it'll read it properly in the end anyway
<Keybuk> it just tends to bitch a bit along the way
<Arafangion> It just makes things a bit confusing for us mortals. :(
<Arafangion> I must say I've been rather impressed with the design of upstart, nice and small, and simple.
<Arafangion> That reminds me - how _do_ I get upstart to log itself verbositely to a file?
<Keybuk> for things like that, I'd just rather fix the underlying problem
<Keybuk> you can't
<Keybuk> there's generally no filesystem to log *to* :-)
<Arafangion> Well, it generally logs already, and that can be redirected, but how do I specify '-v' to init?
<Keybuk> kernel command line
<Keybuk> you can give it --debug too for even more
<Arafangion> So, I do init=/sbin/init -v"
<Arafangion> ?
<Arafangion> But how would -v become associated with the init parameter?
<ion_> Just add plain -v to the kernel command line.
<Keybuk> init=/sbin/init -v
<Arafangion> ion_: And that wouldn't conflict with any other parameters any other programs want?
<Keybuk> kernel passes all parameters to init
<Arafangion> Or is init always the last parameter?
<Arafangion> Ahh, I see.
<Arafangion> How come I haven't recieved my mail to the udev mailing list?
<Arafangion> *upstart, not udev*
<Keybuk> are you subscribed to the list?
<Arafangion> I believe so.
<Arafangion> And I've responded to the latest email sent on that list.
<Arafangion> upstart-devel
<Keybuk> it didn't hit the moderator queue
<Arafangion> Was it blocked?
<Arafangion> Oh, *sigh*.
<Arafangion> <censored> mail client.
<Arafangion> Is the default reply to the user, nto the list?
<Arafangion> Hmm, evidently.
<Keybuk> user
<Arafangion> Hmm, it's quite a moderated list. :)
<Arafangion> Probably wise.
<Keybuk> it's not moderated
<Keybuk> just limited to subscribers
<Arafangion> Well, it says:     Post by non-member to a members-only list
<Arafangion> yet I'm obviously a subscriber, since I recieved the email in the first place.
<Arafangion> Oh, my mistake.
 * Arafangion used a different email address.
 * Arafangion is feeling very 'newbie' today. :(
<Keybuk> I can accept that one
<Arafangion> I do find it rather peculiar that ubuntu does not seem to use upstart's extra features - it's still entirely in sysv compatibility? (That correct?)
<Keybuk> right
<Keybuk> that's correct
<Keybuk> why peculiar?
<Arafangion> Because I seem to suspect that the only reason why ubuntu wanted upstart was becuase "nothing else was good enough", yet they still do everything the same way.
<Keybuk> Upstart's still being developed
<Arafangion> Yes, there's that, I guess I'm just used to Debian. If it were debian, it'd already be starting to be integrated into the main distro properly, imho.
<Arafangion> Not stable, mind you, it'd be in testing or unstable. ;)
<Keybuk> not true
<Keybuk> you can't integrate something unfinished
<Keybuk> you have to finish it first
<Keybuk> especially if the bits that aren't finished are the bits that let you integrate it
<Arafangion> That's what unstable and experimental are for. ;)
<Arafangion> What are the current showstoppers for upstart, though?
<Keybuk> no
<Keybuk> unstable is for packages intended for release
<Keybuk> you wouldn't put something there that simply doesn't boot
<Keybuk> experimental, perhaps
<Keybuk> but that's just a playground
<Keybuk> main showstopper is that it's not possible to develop complex interdependencies between jobs
<Keybuk> or relate those to hardware
<Arafangion> What's an example of such a complex interdependency?
<Keybuk> <Arafangion> Hey guys, how do I send an event whenever my eth0 becomes up?
<Keybuk> for example
<Keybuk> :p
<Arafangion> Heh, but arguably, it should be sufficient to have udev start a script that then does some monitoring, though it would indeed be even nicer if that was part of the job itself, as perhaps another stanza.
<Keybuk> udev shouldn't start things like that
<Keybuk> it's a daemon for getting devices created
<Keybuk> not a device manager
<Arafangion> Perhaps, but it already has the functionality.
<Keybuk> no, it doesn't
<Arafangion> And to do what I wanted with eth0, you need the signal from udev anyway, so udev's already a requirement.
<Arafangion> It doesn't?
<Keybuk> not true
<Keybuk> you want to use HAL
<Arafangion> run+="foobar"?
<Arafangion> Hmm.
<Keybuk> how do you stop foobar?
<Arafangion> Good question.
<Jc2k> ooh thats magic
<Keybuk> hmm?
<Jc2k>  [i=scott@conference/ubuntu-developer-summit/x-23c3b871e5ad4e13]
<Keybuk> yeah, it's a Cloak
<Keybuk> we're all at the same IP address, so FreeNode would k-line us for "cloning" otherwise
<Keybuk> so we tell them that we're at a conference, and they add a magic cloak
<Jc2k> i c :)
<Jc2k> oh well, back to sync coding.
<Jc2k> my BDFL wants to drum up some attention at UDS with pretty Planet Gnome posts..
<Jc2k> holy cow. seems conduit is on the board of topics...
 * Jc2k works harder
#upstart 2008-10-20
<sadmac2> Keybuk: file:///home/rdu/cdahlin/upstate/coverage/state_rb.html
<sadmac2> wait
<sadmac2> Keybuk: git://fedorapeople.org/~sadmac/upstate.git
<sadmac2> too many cut buffers
<sadmac2> that
<sadmac2> that's the state machine
<ion_> Ah, i was just about to open the first URL by exploiting the vulnerability in your sshd.
<sadmac2> heh
<ion_> Ew, hardcoded ANSI sequences.
<ion_> printf "%s%sbold red%s\n" $(tput setaf 1 2>/dev/null) $(tput bold 2>/dev/null) $(tput sgr0 2>/dev/null)
<sadmac2> ion_: oic
#upstart 2008-10-21
<ion_> http://steike.com/code/useless/zip-file-quine/
<sadmac2> ion_: where is the zip file quine?
<sadmac2> I just see a nun advertizing (from my little spanish) "shito"
<ion_> The image links to it.
<sadmac2> ion_: you're a bad person
<ion_> Huh?
<ion_> I wasnât the brilliant person who made that. :-)
<sadmac2> ion_: you're perpetuating it. soon the whole world will be lost. the streets will stop moving as billions of people sit trapped, stuck to their computers or laptops or pdas, ceaselessly unzipping, forever.
<ion_> Whatâs wrong with perpetuating it? :-P
<sadmac2> :'''(
<ion_> sadmac: Youâre a fan of both ruby and git? I want to have your baby.
<sadmac2> ion_: yes, yes. I have many charms.
#upstart 2008-10-22
<sadmac> ion_: I posted that zip file on 4chan and told them there was porn in it.
<sadmac> And I said /you/ were evil :)
#upstart 2008-10-23
<sadmac2> Keybuk: could you push a libnih that has your latest version of the cursored foreach and un-reverts the timeout change?
#upstart 2008-10-24
<sadmac2> Keybuk: around?
<Keybuk> yup
<sadmac2> Keybuk: could you commit your tweaks to the cursored foreach safe?
<ion_> GStreamer is painful, partially thanks to GObject OO, which causes the equivalent of
<ion_> end
<ion_> class Foo
<ion_> to be, like, 100 lines of code.
<sadmac2> ion_: yes. GObject hurts
<sadmac2> ion_: Gstreamer is alright in some other languages. Ruby has bindings that seem ok, but they aren't stable enough to use
<ion_> I want to write a plugin; i guess i have do it in C.
<sadmac2> ion_: what's the plugin do?
<ion_> Really gapless playback of successive songs, taking possible silence in the beginning/end of audio stream into account. (Not crossfading.)
<sadmac2> ion_: most music players I've seen don't even get normal gapless playback right
<ion_> Indeed
<sadmac2> ion_: though that's probably possible in current gstreamer. just not done right
<Keybuk> sadmac2: I'm not happy with it yet
<sadmac2> Keybuk: me neither, but that's no reason to keep it out of source control :)
<sadmac2> its less broken than head
<Keybuk> I'm not sure that's true
<Keybuk> there's too much potential for bugs by having the cursor in the linked list
<Keybuk> you can no longer assume that foo->next is of the same type as foo
<sadmac2> Keybuk: which is why we need to get rid of foo->next
<sadmac2> in code outside the libs
<sadmac2> NIH_LIST_NEXT()
<Keybuk> I disagree
<Keybuk> it makes other code too inefficient
<sadmac2> Keybuk: we're running out of options
<sadmac2> Keybuk: I've already tried non linked list data structures, and we get similar issues
<sadmac2> Keybuk: any other solutin is going to make list_head bigger. We need information to do this
<Keybuk> I suspect it's not a problem anyway
<Keybuk> since the cursor is of the same size as the list head
<sadmac2> Keybuk: which is not a problem?
<Keybuk> right
<Keybuk> I don't think the kinds of uses for which you would iterate a linked list are the same as those you'd expect the next element to be of a particular size
<sadmac2> Keybuk: we use tne next pointer quite a bit in the test cases for init, but only in a couple places in the actual software
<Keybuk> right
<Keybuk> and in the test cases, we always check the size ;)
<Keybuk> in fact, checking the size is one of the fundamental tests
<sadmac2> Keybuk: that's how we could find cursors.
<sadmac2> Keybuk: we could ask nih_alloc how big the memory area is
<sadmac2> oh, that's still a problem for stack.
<sadmac2> nvm
<sadmac2> wait, what does happen if you size-check a stack pointer?
<Keybuk> size check only works if allocated with nih_alloc
<Keybuk> you'd get a core dump probably
<Keybuk> or invalid data
<Keybuk> valgrind would certainly notice
<sadmac2> figured
<Keybuk> in almost every circumstance, you'd fail the nih_alloc assert() if you don't coredump
<sadmac2> ok, looks like we never grab next inside the iterator in init
<sadmac2> hoo!
<sadmac2> we never do it in util
<Keybuk> I think I only ever do it on a list head to get the first entry
<sadmac2> which will only fail for a few moments between when the loop puts the cursor there and when the loop realizes the cursor's there and terminates
<sadmac2> so until we go multithread (if we do) all is well
<Keybuk> I'd kinda like to make libnih threadsafe one day
<sadmac2> does it have to be today?
<sadmac2> concurrent linked lists are a clusterfuck
<sadmac2> and you're going to need a semaphore in list head, which means we add that extra word again
<sadmac2> so what does that leave to figure out with the current list though?
<sadmac2> we still need to make insert-before work
<Keybuk> I'm not too worried about that atm
<Keybuk> I never do it :)
<sadmac2> ok
<sadmac2> then we've fixed the issue :)
<Keybuk> Testing event_pending()
<Keybuk> BAD: wrong value for event->progress, expected 1 got 2
<Keybuk> 	at tests/test_event.c:249 (test_pending).
<Keybuk> zsh: abort (core dumped)  ./test_event
<Keybuk> ...
<Keybuk> Testing event_pending()
<Keybuk> ==31387== Invalid write of size 8
<Keybuk> ==31387==    at 0x42BC9C: nih_list_add (list.c:147)
<Keybuk> ==31387==    by 0x42C203: nih_hash_add (hash.c:179)
<Keybuk> ==31387==    by 0x405301: test_pending (test_event.c:244)
<Keybuk> ==31387==    by 0x414A61: main (test_event.c:1987)
<Keybuk> ==31387==  Address 0x7ff000558 is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes
<Keybuk> *giggle*
<Keybuk> that implies a cursor is getting left in the list
<Keybuk> oh, I have something fun you can't do from an NIH_LIST_FOREACH_SAFE
<Keybuk> return
<Keybuk> (the list will be invalid)
<sadmac> well shit
<Keybuk> that wasn't that bug though
<sadmac> you could fix the return thing by defining a nested function
<sadmac> make your own stack frame
<sadmac> trouble is getting the return type of the function you're in
<Keybuk> this cursor thing causes *massive* problems
<Keybuk> all basically summed up as:
<Keybuk> cannot nestedly iterate the same linked list twice
<ion_> Mmkay, the Finnish government has dedicated a team of ten police officers to âmonitor the Internetâ for âthreatening contentâ, with a budget of a million â¬ a year.
 * Keybuk wonders what the Finnish government would find threatening
<ion_> Iâm not entirely sure, but itâs a part of a knee-jerk reaction to a school shooting, where the shooter posted some videos of himself doing target practice and behaving all macho in advance.
 * Keybuk giggles
<Keybuk> NihList __attribute__(cleanup(nih_list_destroy)) _##iter##_cursor = { &_##iter##_cursor, &_##iter##_cursor }
<Keybuk> I think that solves the "return from the loop" issue :p
<ion_> Ooh
<Keybuk> that makes the definition just:
<Keybuk> define NIH_LIST_FOREACH_SAFE(list, iter)                               \
<Keybuk>         for (NihList  _##iter __attribute__((cleanup(nih_list_destroy))) = \
<Keybuk>                               { &_##iter, &_##iter }, \
<Keybuk>                      *iter = nih_list_add_after ((list)->next, &_##iter)->prev; \
<Keybuk>              iter != (list) && iter != &_##iter;                                \
<Keybuk>              iter = nih_list_add_after (_##iter.next, &_##iter)->prev)
 * Keybuk wonders
<Keybuk> if I have an NihListCursor type
<Keybuk> can I use
<Keybuk> __builtin_object_size (iter, 0) == sizeof (NihListCursor)
<Keybuk> :p
<Keybuk> no, because it never evaluates iter :-/
<Keybuk> tho it should apprently
<sadmac2> Keybuk: also as is iter is statically allocated
<sadmac2> Keybuk: and the object could not be a cursor and be statically allocated
<sadmac2> Keybuk: and The object could be a list head inside of another struct. Total size equaling NihListCursor
#upstart 2009-10-19
<superm1> james_w said that this upstart script causes problems with shutdown: http://bazaar.launchpad.net/~ubuntu-mythtv/mythtv/mythtv-trunk-022/annotate/head%3A/debian/mythtv-backend.upstart
<superm1> because /bin/su opens a pam session.  if not via /bin/su, what's the right way to run an upstart started system daemon as a diff user?
<Keybuk> why is su not the right way?
<Keybuk> is mythtv-backend supposed to run as a user
<Keybuk> or as a different uid
<Keybuk> (they're different things :p)
<superm1> i'm not sure why james_w said that su wasn't the right way, let me have him pop in here to indicate why he was thinking
<superm1> different user (i think), because want to have the right $HOME etc as that user
<james_w> hey
<superm1> james_w, "<Keybuk> why is su not the right way?"
<Keybuk> there's a difference between
<james_w> bug https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/445953
<Keybuk> "foo service needs to run as user bar"
<Keybuk> and
<Keybuk> "foo service needs to run as uid bar"
<Keybuk> which do you want? :)
<Keybuk> james_w: isn't that a bug in whatever's asking for the passphrase?  it should ignore non-interactive logins, surely?
<james_w> I don't know
<james_w> well
<james_w> this is something that has been in flux
<superm1> Keybuk, what characteristics would come with running as a different user versus differ uid?
<james_w> previously there was no way for it to know whether a login was interactive
<Keybuk> yes ther eis
<Keybuk> there's been a way for 30-40 years
<james_w> then we got the /etc/pam.d/common-session{,-noninteractive} split
<Keybuk> it's called utmp
<Keybuk> superm1: well, for a start, having a PAM session ;-)
<james_w> ok, given its architecture it didn't know
<Keybuk> superm1: that implies having the environment of that user, e.g. $HOME set right and stuff
<james_w> this split makes it work in the common case
<Keybuk> james_w: that's still a consolekit bug though
<superm1> Keybuk, okay then definitely we want it running as a user.  it does make reference to stuff in $HOME
<james_w> but it is assumed that /bin/su is an interactive login
<Keybuk> (or a pam bug)
<Keybuk> james_w: why?  su is only a *login* if run with -, -l or --login
<james_w> consolekit has a narrow interface to this
<james_w> pam-ck-connector creates a consolekit session from the pam stack when it is included the pam config for that service
<Keybuk> so? :)
<Keybuk> it's still a bug at that end
<Keybuk> superm1's upstart job *does not* create a login shell
<james_w> I'm not arguing that this is the correct way to do things
<Keybuk> so no login shell or interactiveness should be assumed
<james_w> I'm telling you the status quo
<Keybuk> :)
<james_w> if you know how to fix pam-ck-connector so that we can not create sessions for non-interactive sessions that would be useful
<james_w> this is the first time we have hit this with upstart jobs.
<Keybuk> I don't know enough about PAM
<james_w> with init scripts the fix is easy as start-stop-daemon has --chuid
<Keybuk> or CK
<Keybuk> james_w: that's why I asked right at the top
<Keybuk>  is mythtv-backend supposed to run as a user
<Keybuk>  or as a different uid
<james_w> and I don't know enough about anything
<james_w> it sounds like it would be useful to have you, pitti and slangasek locked in a room for 30 minutes to work out the best solution
#upstart 2009-10-20
<zx2c4> hey
<zx2c4> im wondering about OpenRC vs Upstart, and Upstarts inclusion in gentoo... anyone have anything to say about this?
<mbiebl> zx2c4: I guess you could run OpenRC on top of Upstart
<mbiebl> you have to keep in mind, that OpenRC does not provide /sbin/init
<mbiebl> It's basically a sophisticated version of Debian/Ubuntus' sysv-rc package
<tavasti> How I disable service on upstart? By editing start script?
<Keybuk> comment out the "start on" line
<tavasti> are those /etc/init/* files config files for dpkg, so they won't be overwritten by package upgrade?
<Keybuk> they're dpkg conffiles in Debian/Ubuntu-based systems, yes
<tavasti> ok, thanks for your help!
<tavasti> This side of the system is not very well documented, either on man pages or web
<tavasti> or I'm just using bad keywords for searching :-(
<Keybuk> that's because it's not the "proper" way to do it
<Keybuk> there isn't a proper way
<Keybuk> (yet)
<tavasti> :-(
<tavasti> but still upstart has been in ubuntu for several releases, oh my
<Keybuk> so?
<tavasti> at least I think having proper way to configure boot-up sequence would be needed
<tavasti> at least in server environment
<tavasti> but that's only my opinnion, nothing more
<tavasti> anyway, thanks for help. Bye!
<Keybuk> some people have no concept of the term "in development", do they?
<wasabi__> UDS in Dallas this year? Silly
<wasabi__> Should be nice, ya'll coming to me this time.
<Keybuk> ;)
<Keybuk> this UDS, I want a *real* cowboy!
<Daviey> Keybuk: that cowboy would go wonderfully with that sparkly pony we all want.
#upstart 2009-10-21
<magcius> I heard that in Karmic, Upstart was "turned on"
<magcius> What does this mean? What exactly did Karmic do? All I see about Upstart's documentation is the SysV compatibility script mode/
<mbiebl> magcius: It means, all/most sysv init scripts for a standard Desktop install have been converted to native upstart jobs
<magcius> What is the main difference?
<magcius> Where can I find the jobs bundled with Ubuntu?
<mbiebl> It's now event based
<mbiebl> not sequentially
<mbiebl> magcius: there is not a single package which ships all upstart jobs
<mbiebl> I guess the easiest would be, to boot a live cd and copy /etc/init/
#upstart 2009-10-22
<Keybuk> ion: make the thing you suggest part of plymouth
<ion> I might. :-P
<Keybuk> because we're going to go for that in lynx I think
<ion> That is, if i ever get around to implementing something like that, it definitely should be part of plymouth.
<Keybuk> I hate usplash too much
<Keybuk> :p
<ion> If the text fallback is clean and pretty, it isnât even that big a problem that some drivers still donât support KMS IMHO.
<Keybuk> indeed
<Keybuk> and it turns out that it hurts boot speed to support non-KMS splash
<Keybuk> because you have to sleep in the hope a KMS driver appears
<Keybuk> then give up, and start the splash instead
<Keybuk> which is, err, about the point you also start X :p
<ion> :-)
<Keybuk> bbiab
#upstart 2009-10-23
<magcius> mbiebl, is there no other easier way to get the jobs?
<Keybuk> Writing /var/lib/ureadahead/sda1.pack
<Keybuk> 508 files, 678 blocks (8425472 kB)
<Keybuk> quest src% sudo ./ureadahead --debug                            
<Keybuk> /var/lib/ureadahead/sda1.pack: created Fri, 23 Oct 2009 20:02:59 +0000 for hdd 8:1
<Keybuk> \o/
<wasabi__> Yeah Keybuk, how does readahead find the blocks that are most important?
<wasabi__> s/yeah/hey?
<Keybuk> mincore()
<wasabi__> hmm
<wasabi__> i'm thinking about making something similar, and running it all the time.
<wasabi__> to identify most important blocks on LVM volumes.
<wasabi__> and move those to a faster PV (SSD)
<Keybuk> it's kinda hard to do it that way
<wasabi__> It is, but the tools are present.
<wasabi__> If I can just find blocks and map to PEs
<wasabi__> Would love to add a 10GB SSD to my 500GB disk array, and automatically have the 10GB of data I use most on it
<Keybuk> /sbin/sreadahead --no-fork  0.00s user 0.14s system 0% cpu 36.128 total
<Keybuk> /sbin/ureadahead --verbose  0.01s user 0.17s system 2% cpu 7.718 total
<Keybuk> ...
<Keybuk> that, is, what, we, call, a, BIG, difference
#upstart 2009-10-24
<Keybuk> bootchart indicates those numbers are realistic
<Keybuk> (boot is even longer with sreadahead if it goes in the background)
<Justin___> Hi, I'm new to Ubuntu and (brand) new to upstart. I'm hoping to use upstart to launch a few shell scripts and I'm having a hard time
<Justin___> Anyone on that could help me?
<mbiebl> Justin___: just ask your questions 
<Justin___> First of several. This script will work when I run it manually from console, but it isn't (apparently) launching at runlevel 2
<Justin___> start on runlevel 2
<Justin___> start on runlevel 3
<Justin___> start on runlevel 4
<Justin___> start on runlevel 5
<Justin___> stop on runlevel 0
<Justin___> stop on runlevel 1
<Justin___> stop on runlevel 6
<Justin___> script
<Justin___>   cd /usr/share/atlassian/crowd
<Justin___>   ./start_crowd.sh
<Justin___> end script
<mbiebl> Justin___: which upstart version do you use?
<Justin___> 0.6.3
<mbiebl> multiple start on stanzas are not allowed in upstart 0.6
<mbiebl> use "start on runlevel [2345]"
<mbiebl> stop on runlevel [016]
<mbiebl> instead
<Justin___> nice
<Justin___> thanks
<Justin___> Q #2: similar theme, but this one doesn't work automatically or manually (but it claims 'started' and gives a pid)
<Justin___> description "Starts JIRA when the computer starts"
<Justin___> start on runlevel [2345]
<Justin___> stop on runlevel [!2345]
<Justin___> script
<Justin___> end script
<Justin___> oops, got truncated
<Justin___> description "Starts JIRA when the computer starts"
<Justin___> start on runlevel [2345]
<Justin___> stop on runlevel [!2345]
<Justin___> script
<Justin___> \/usr/share/atlassian/jira/bin/startup.sh
<Justin___> end script
<mbiebl> Justin___: if it's a one time task
<mbiebl> add the "task" keyword
<Justin___> It is, yeah. (it exits when done)
<Justin___> then make a separate job for the analagous shutdown.sh? (with start on 01?)
#upstart 2009-10-25
<Keybuk> random thought
<Keybuk> fedora people
<Keybuk> does plymouth actually have a long-running process?
<Keybuk> or does it just paint to the screen and exit?
<ion> IIRC, it does animation, so it must have a long-running process.
<ion> Even without graphics, it does a simple text-based animation.
<Keybuk> yeah
<Keybuk> but you could do that by having one process paint the screen
<Keybuk> then if you wanted a throbber, start a throbbler process that animates that bit of the screen
<Keybuk> and if you wanted an input, start a different process that took another bit of the screen for input
<Keybuk> it'd solve the whole fifo issue :)
<ion> True
<ion> But iâd expect a single process that listens on a socket for multiple connections would be simpler to implement.
<Keybuk> possibly
<Keybuk> but then you have to deal with things getting out of the way before X and stuff
<Keybuk> in Moblin, their plymouth-lite thing does just paint the image and go
<ion> True. Animation will also use resources one could use to, say, boot the system. :-P
<Keybuk> yeah
<ion> Even with some magic to retain the splash when X is initializing, until the first X window being painted, animation would seem to get hung for a while, whereas if the splash was static in the first place, things would look quite nice.
<Keybuk> yeah, exactly
<ion> Retain the framebuffer contents, that is
<Keybuk> that's what I was thinking
<Keybuk> have a program to write a static image (THE DESKTOP BACKGROUND!)
<Keybuk> if we need to do fsck, just have a small program that paints over the top in one area of the screen
<Keybuk> if we need to do input, just have a small program that paints over the top in a different area of the screen
<Keybuk> and both of those block X from starting anyway
<ion> How about a splash program that is still long-running and listens on a socket, but actually just draws the static image once and then does single updates for input/progress? It would solve the same issue, but it would be more efficient, there would be no need for different things to have predefined display areas (it could allocate them when on demand) and it could easily handle the âmultiple clients want input, use tabulator to switch focusâ case.
<Keybuk> that would work too
<Keybuk> then at least you could show multiple progress bars
<Keybuk> and ask for multiple passphrases
<Keybuk> and I guess you'd want cancellation and stuff
<ion> It could also easily do the pretty text UI when KMS is not available.
<Keybuk> right
<Keybuk> which is I guess how plymouth works
<ion> keybuk: http://heh.fi/tmp/text-splash-mockup.png http://heh.fi/tmp/text-splash-mockup.text :-P
#upstart 2010-10-25
<ion> o hai
<Keybuk> hai
<Stevee> hello scott
<Keybuk> hello
<Stevee> yes, I know I'm nerving you, but I have to ask once again: Is there any kind of release date of the next major version of upstart, or some kind of possible periode ( for example this year, or spring next year ... )
<Keybuk> it's a "when it's ready"
<Keybuk> the new release changes many fundamental things in the core, in an attempt to correct all of the problems I've had (and others have reported)
<Keybuk> and the goal is that it'll stablise to be 1.0
<Keybuk> obviously I don't want to change the core again after this
<Keybuk> so I'd rather release when ready than release on a given time, and then upset the apple cart all over again
<jds2001> so i have a usecase with sysvinit that i'd like to duplicate with upstart
<Keybuk> sure
<Keybuk> would love to hear it
<jds2001> it's the concept of a "firstboot" runlevel.
<Keybuk> does sysvinit have such a thing?
<jds2001> we install an inittab with runlevel 9 as initdefault
<jds2001> runlevel 9 does stuff, and cleans up after itself.
<Keybuk> ah, I see
<jds2001> I've defined a runlevel 9 in /etc/init, but when I boot, it just says "invalid runlevel"
<Keybuk> I do something quite similar with Upstart for boot testing
<Keybuk> an /etc/init/foo.conf runs, and as a final step, deletes itself
<Keybuk> the invalid runlevel is a whole Debian/RH thing - Debian's sysvinit never supported 7,8,9,a,b,c runlevels afaik
<Keybuk> that was a quirk of RH's
<jds2001> here's the thing - i dont want anything except rc-sysinit to run, then run this, then clean up and reboot
<Keybuk> (Debian instead gives you 3,4,5 to play with for your own, as 2 is the default)
<Keybuk> anything?
<Keybuk> you don't even want filesystems mounted?
<Keybuk> or udev started?
<jds2001> rc-sysinit takes care of that, right?
<jds2001> this is rhel6, btw
<Stevee> thanks for the reply Keybuk, I'm just wondering last rel of a version i quite a half year ago, after that some patches and it's hard / impossible to follow the current development process ...
<Keybuk> jds2001: I dont know about RHEL, I'm afraid
<Keybuk> are they still using Upstart?  I'd heard they went to systemd
<Stevee> I love upstart it's a relly good init system but the current version looks like unfinished, especially if you aren't using the compatiblity mode
<Keybuk> but in Ubuntu, Web OS and Chrome OS (the three major Upstart distros) - everything is done as Upstart jobs, rc-sysinit is only there for backwards compatibility with older packers and LSB things dropped in
<Keybuk> Stevee: there isn't a compatibility mode?
<Keybuk> Ubuntu has had an entirely native boot for three releases now
<jds2001> Keybuk: yeah, it's not native. in rcS.conf it runs the old rc.sysinit
<jds2001> and has a 'start on startup' in it.
<Stevee> yes i know, but i mean, without any runlevels - full event based ...
<Stevee> .. thats somethimes really difficult to handle
<Stevee> fedora scheduled to swith to systemd with fc14 but dropped that and now will do that with fc15
<Stevee> so they are still using upstart
<jds2001> and rhel6 will use it for it's lifetime as well.
<jds2001> sadmac: you around by chance?
<sadmac> jds2001: hey
<jds2001> ltnt :)
<jds2001> figured you'd be a good point for my rhel6 query :)
<jds2001> i need something to execute after rc.sysinit, prior to anything else, which will do stuff, clean up after itself, and reboot.
<jds2001> sort of a "firstboot" type thing.
<jds2001> and I'm having a heck of a time figuring out how to do it. In rhel5, we just used an initdefualt to runlevel 9, whcih seems not to work in upstart :(
<sadmac> jds2001: yeah I don't think we retained the 789 quirk as Keybuk says. I never saw a patch to add that back
<jds2001> yeah, any other way to accomplish similar goals?
<jds2001> i.e. what event happens after rcS.conf that I can 'start on'?
<jds2001> i see that as being a task, and at the end it would delete itself and reboot.
<jds2001> or am i completely on crack?
<sadmac> jds2001: you could make it start on starting rc
<sadmac> jds2001: which would block the normal runlevel from getting started and run your task instead
<sadmac> jds2001: but it'd resume booting afterward, so you'd have to reboot at the end of your task
<jds2001> sure, we do that anyway
<sadmac> jds2001: also it'd do this every time regardless of runlevel, so you'd have to have it detect if it was supposed to be running and quit if it wasn't.
<jds2001> i thinik if it's there, it should run.
<jds2001> we do that today - if it doesnt get cleaned up, the initdefault is still 9
<sadmac> jds2001: that works too
<jds2001> that way if it gets b0rked, we know :)
<jds2001> i'll play around and let you know if I have problems....
<sadmac> k
#upstart 2010-10-26
<evident> hi everybody! I am having problems with procps on my server... each time I call apt-get upgrade, I get some long error because of dependency problems which all seem to have their origin in procps:
<evident> http://hpaste.org/40892/upgrade
<evident> Can anybody tell me what I can do to fix this?
#upstart 2010-10-27
<theblueone> forgive me if this is naive, but where does upstart log to on ubuntu maverick 10.10 by default? I can't seem to find this anywhere
<ion> syslog
<theblueone> ion: thx
<theblueone> ion: as an extension, though the 'console logged' stanza seems to be default in upstart >0.6, it doesn't seem as if indiv. processes output is logged to syslogâis there a location I can find these, or is more work required?
<ion> Thereâs no such setting in 0.6. Output logging provided by Upstart is in TODO, but for now, youâll need to implement your own. E.g.
<ion> script
<ion>   exec >/path/to/log 2>&1
<ion>   (the usual stuff)
<ion> end script
#upstart 2010-10-28
<quidnunc> Why does upstart predepend on libc 2.11 but I have 2.12 installed?
#upstart 2010-10-29
<NoobFukaire> if exec is called when an upstart job is initiated, where do you specify the shutdown procedures?
<NoobFukaire> should  use pre-stop ?
<NoobFukaire> its amazing that someone would write a utility like upstart, that manages starting and stopping services
<NoobFukaire> and totally screw up the stopping services part
<dumb_ass1> hello
<dumb_ass1> is dbus a strict requirement for upstart to work correctly?
<mbiebl> pippo: libdbus is a hard requirement
<mbiebl> dbus is recommended for (user) communication
<pippo> what all is required instead to support the old system-v init scripts?
<pippo> how do i trigger an event on my own?
<ion> initctl emit
<pippo> how do i avoid some /etc/init/xyz.conf from emitting xyz ?
<pippo> s/avoid/prevent/
<ion> By commenting out the line that emits it, for instance.
<pippo> mmm
<pippo> there's a line explicitly emitting it?
<ion> Perhaps. You didnât define xyz and my crystal ball isnât working right now.
<dumb_ass> i don't see any emit in the upstart script the other scripts should be depending on, and yet these other scripts get executed
<ion> See for instane starting(7) and the ones in its âsee alsoâ section.
<ion> c
<dumb_ass> here we are supposed to be triggered by "started"
<dumb_ass> and i assume "started" is triggered by the "end script"
<ion> No, see started(7). Itâs emitted when a job has finished starting and is running. Upstart job definitions arenât sequential scripts.
<dumb_ass> so, is it the first line in the script that they are looking at?
 * dumb_ass is grabbing a hold of an installation with man pages
<ion> What is looking at?
<ion> See init(5) for documentation about the job definition syntax.
<dumb_ass> upstart...
<dumb_ass> looking at init
<ion> By default, a service-type job has started when the pre-start script (if any) has been run, the main script (if any) has been started and the post-start script (if any) has been run.
<dumb_ass> oh...
<dumb_ass> thanks!
<dumb_ass> nope
<dumb_ass> oh
<dumb_ass> this is braindead
<dumb_ass> i am about to have a heat-stroke
<dumb_ass> it doesn't give a shit about the main script
<dumb_ass> but what matters is the post started, if present
<ion> huh?
<dumb_ass> i am outraged
<_dvorak_> does the "respawn" work even if I use the "script/end script" pair
#upstart 2010-10-30
<ectospasm> I ran a service with "respawn limit 0 10" thinking it would limit it to one and only one process ("limit 1 10" seems to allow two processes), and my system bombarded itself with respawned processes, such that I had to hit the power button, boot into recovery, edit the respawns out of the script...  Is there a way to tell respawn only to allow one process for the service, and respawn it if it fails?
<raeez> ectospasm: though I'm not fully certain, I'm under the impression that simply indicating the respawn stanza should give you the behaviour you're looking for
<raeez> i.e. 'respawn' wit no arguments
<ion> Respawn limit has nothing to do with the number of simultaneous processes.
#upstart 2011-10-24
<bradleyayerswork> yeah, why are you daemonising?
#upstart 2011-10-26
<maruq> hi guys
<maruq> having some fun trying to debug a upstart job
<maruq> I was trying to use init-checkconf to verify the file, but seem to always get "ERROR: failed to ask Upstart to check conf file"
<maruq> this is true for system upstart jobs too
<maruq> I've tried the Canonical AWS images for 11.04 & 11.10, occurs on both
<FunnyLookinHat> Hello!
<FunnyLookinHat> I'm having trouble debugging an upstart script for lightdm
<FunnyLookinHat> http://pastebin.com/mGCYmzhR
<FunnyLookinHat> Could anyone explain what the line that includes "drm-device-added" means? 
<FunnyLookinHat> Are the spaces between those conditions treated as "and" statements or something else?
<FunnyLookinHat> Because when I echo $UPSTART_EVENTS within the script portion of that config file, it only lists "filesystem runlevel started stopped"
<FunnyLookinHat> And I would at least expect udev-fallback-graphics in addition to stopped.
<FunnyLookinHat> Ok - done spamming you now.
<jhunt> FunnyLookinHat: drm-device-added -> "man upstart-events" (it's a udev event). For "and" info, see "man 5 init" or the cookbook. Same for UPSTART_EVENTS.
#upstart 2011-10-27
<Laibsch> how I do completely prevent an upstart job like the one for the ssh server to start without explicitly calling it?
<Laibsch> I tried to google this but didn't find instructions
#upstart 2011-10-28
<tylerflint> is it possible to have upstart send a USR2 signal on reload instead of HUP ?
<cjs226> if i want to disable Ubuntu's Upstart shutting down rsyslog can i just comment out the stop line in /etc/init/rsyslog.conf?  I'm wanting to get every last message before a system is spun down
#upstart 2011-10-30
<rrva> is upstart really mature for servers?
<rrva> I've had issues with upstart hanging when trying to stop jobs if the process died
<rrva> or upstart thinking the process was running when its really not
<ion> Usually that symptom is the result of lying to Upstart about the forking behavior of a main process, i.e. an inappropriate âexpectâ value.
<ion> http://heh.fi/tmp/workaround-upstart-snafu to work around that.
<rrva> how to recover upstart state if I misconfigured this
<rrva> only reboot would help?
<rrva> ion: upstart should auto-heal from such lies. This is all too common
<rrva> ion: thanks for the script
<ion> Yes, a robust implementation of fork following is in TODO and a working prototype exists. But for the moment, âexpectâ should only be used if youâre completely sure of the behavior of the main process wrt. forking. By doing that you should find Upstart rock solid.
<ion> Note that Upstart never crashed, it only lost track of a misconfigured job.
<rrva> yes.. please consider "auto-heal losing track of process" code
#upstart 2012-10-22
<diverdude> hello, i have specified environment variables as env NAME=VAL but for some reason the executable specified below as exec /path/to/file cannot find the .so files anyway....should these environment variables be set in a different way?
<slangasek> diverdude: from your description that sounds like the right way to do it; you may want to post a full copy of your job?
<diverdude> i found it....its because apparantly i cannot do eg. env NAME=VAL where VAL is $HOME/some/path. It seems that will be rendered to $HOME/some/path instead of /home/username/some/path...for some reason
<slangasek> because a) 'env' does itself not do variable expansion, and b) where do you expect $HOME to be set from
<diverdude> slangasek: $HOME was just an example....in my script i was setting an env var and using it in the line below
<slangasek> ok
<slangasek> so you could do variable expansion by hand in the 'script' part by calling eval
<slangasek> but it's probably not worth it
<diverdude> nah i just wroite it manually
<slangasek> it's *probably* better to just set the final value of the variable manually, yeah
<diverdude> What is the latest stage i can start the daemon automatically on bootup?
<diverdude> ?
#upstart 2012-10-23
<tom__> I'm trying to debug/understand high init cpu/memory use when creating lots of network interfaces
<tom__> these are virtual interfaces, and I'm creating of the order of 10-15 of them per second
<tom__> on my ubuntu 12.04 server install I see init using up to 90% CPU at times, with memory use increasing from around 0.8% when I boot to around 8% when I get to around 30k virtual interfaces
<tom__> If I disable the upstart-udev-bridge process (service upstart-udev-bridge stop) before I create the virtual interfaces, the high cpu/memory usage goes away -- so it looks like upstart is somehow behaving badly in the face of lots of virtual interfaces
<tom__> Does anyone have any ideas on this?  Am I being foolish in stressing upstart in this way?
<SpamapS> tom__: are you creating them, and then removing them?
<SpamapS> tom__: I think we identified a problem with the network-interface-security jobs where instances are not stopped recently
 * JanC wonders why anybody would want to create 30k virtual network interfaces  âº
<tom__> SpamapS: no, I'm just creating them.  They may then be bought up using the ip command, but they stay in existence 
<tom__> JanC: good question ;-) it's for an L2TP configuration, bridging lots of ethernet sessions at the server end
<JanC> ah, a VPN server, that makes sense indeed   âº
<SpamapS> tom__: I doubt anybody has tested 30,000 job instances, so perhaps there is a scalability problem with upstart
<SpamapS> tom__: I'd be interested to attach gdb and measure where its spending its time
<tom__> SpamapS: is there a good way to measure runtime behaviour with gdb?  I've used it as a "poor man's profiler" before (interrupting periodically, grabbing a backtrace, analysing the resulting traces), but that's a bit tedious
<tom__> Hmm, it looks like one may reproduce at least some of the same behaviour using veth interfaces
<tom__> For example: for i in {1..30000}; do sudo ip link add name vbl${i}_0 type veth peer name vbl${i}_1; done
<tom__> Running this up in a VM shows init CPU usage at around 10-15%, memory usage currently at 5.7% and counting
<tom__> My VM is a somewhat different environment to the box I referred to earlier -- the VM has an i7 core to play with, while the hardware machine I typically use for testing is a venerable Athlon 64
<SpamapS> tom__: http://poormansprofiler.org/
<SpamapS> tom__: actually there's one huge problem with that which is that init is doing ptraces, so it can't be ptraced properly IIRC
<tom__> SpamapS: cool link -- I'd not come across that before.  I had my own version of the same thing!
<tom__> SpamapS: FWIW, I tried it out on my VM, which is now rather bogged down with some 29k veth interfaces, and has upstart eating around 80% CPU
<tom__> SpamapS: here's 10 iterations of the Poor Man's Profiler:
<tom__>      10 ??,job_process_handler,nih_child_poll,nih_main_loop,main
#upstart 2012-10-25
<carif> is the exit status of an upstart job available to the post-stop script say as $?
<carif> or some kind of variable?
<carif> EXIT_STATUS
<mark7> Hey, all.  Is there a way to set log-priority via Upstart's config files?  I'd kinda expect there to be, but Google doesn't see anything...
<mark7> Or is the approved mechanism for debugging Upstarted-related boot issues to just twiddle the kernel args to have --verbose passed?
#upstart 2012-10-26
<JanC> mark7: adding it to the kernel parameters is the way to go
<JanC> you can do that by adding it in /etc/default/grub of course (if you are on Ubuntu, at least)
<mark7> Yup.  All right, thanks.
#upstart 2013-10-21
<kms_> hello
<kms_> enybody here?
<kms_> ?
#upstart 2013-10-26
<Miranda``> I've added the /etc/init/xbmc.conf upstart job and changed Xwrapper.config, XBMC loaded correctly once. I switched to another terminal and fired up 'startx' to install nvidia-driver, now when I reboot, it goes to the desktop instead of XBMC. Any ideas why?
<Miranda``> It's almost like it's trying to start 2 instances of X. I've got an Xorg.0.log as well as an Xorg.1.log, both with the same creation date/time
<shawn> hello upstart superheroes
<shawn> anyone know if upstart 1.5 should support instance variable names in other stanzas such as setuid?
<shawn> if I have instance $user
<shawn> can I have a stanza like 
<shawn> setuid $user
<shawn> ?
<shawn> it doesn't seem to work on my ubuntu machine
<xnox> shawn: setuid stanza accepts either numeric or symbolic name.
<xnox> shawn: not variables.
#upstart 2014-10-24
<Shrikant_> Hi, I am new to upstart.Can anyone tell me usage of .override and .conf files
#upstart 2015-10-21
<geomyidae_> Why does upstart say my service is start/running, when it only contains a single "echo" statement that I already see in the log file?
#upstart 2015-10-22
<lnykryn> if I tell upstart to reexec, is there any reliable way to tell that it was done?
<lnykryn> ideally without dbus
<JanC> lnykryn: do you  mean in a script or manually?
<lnykryn> JanC: in script
<JanC> well, you can check the time when process 1 started
<lnykryn> JanC: something from /proc?
<JanC> for example, or using ps
<lnykryn> JanC: hmm, it looks that that reexec does not change that time
#upstart 2015-10-24
<bianconi> Hi everyone - I'm trying to run a Flask web app with nginx + gunicorn + upstart, but I'm having some trouble. If I use the following .conf: http://pastebin.com/raw.php?i=qrx5CEgk the job starts but nginx gives an Error 502. If I simply run that command on terminal, the app works fine. Any ideas? Thanks!
