#upstart 2006-11-06
<jiger> hello how can I check if I am booting via upstart or no?
<cortana> jiger: check /proc/1/exe ?
<jiger> there is no /proc/1/exe
<jiger> top shows 1 as init
<cortana> then you're not using linux... perhaps you don't have permission to read it, i seem to only be able to read it if i am root
<jiger> ohhh wait only works with sudo. hmmmm but ls shows nothing
<jiger> wonder why booting kubuntu takes so long
<jiger> cortana: and why is process 1 init?
<cortana> well it's a symlink to a processes' executable file
<cortana> it guess it depends how you have upstart installed
<cortana> maybe it has replaced the /sbin/init file
<jiger> cortana: but isn't upstart executable called upstart?
<cortana> depends how you have it installed
<jiger> cortana: any definitive way to check>
<cortana> i don't even have it installed here :)
<cortana> ask your package manager what owns the file?
<jiger> cortana: I did a dapper to edgy
<jiger> cortana: u ain't running ubuntu?
<jiger> cortana: command?
<cortana> dpkg --search i think
<jiger> upstart-compat-sysv: /usr/share/doc/upstart-compat-sysv
<jiger> system-services: /usr/lib/upstart/migrate-inittab.pl
<jiger> upstart-logd: /usr/share/doc/upstart-logd
<jiger> upstart: /usr/share/doc/upstart/copyright
<jiger> upstart: /usr/share/doc/upstart
<jiger> upstart: /usr/share/doc/upstart/changelog.gz
<jiger> upstart: /usr/share/doc/upstart/NEWS.gz
<jiger> upstart: /usr/share/doc/upstart/AUTHORS
<jiger> upstart: /usr/share/doc/upstart/changelog.Debian.gz
<jiger> system-services: /usr/lib/upstart
<jiger> upstart: /usr/share/doc/upstart/README.Debian.gz
<jiger> strikes anything?
<cortana> it's dpkg --search /sbin/init
<cortana> to find out what package owns /sbin/init
<jiger> upstart: /sbin/init
<jiger> good? ontrack?
<cortana> then it seems you are using upstart
<jiger> cortana: then wonder why it is so slow to boot
<cortana> afaik upstart doesn't make anything aster
<cortana> *faster
<jiger> cortana: slightly slower than dapper
<cortana> but i can't really say since i don't use it
<jiger> cortana:  doesn't it load possible services in parellel ?
<jiger> cortana: might not be immen. but in future aim?
<cortana> maybe, but if those services are both competing for the same resource then they won't load any quicker
<jiger> cortana: hmmm hope next ubuntu makes it fast.
<jiger> cortana: thanks for the help
<madduck> Keybuk: http://www.metager2.de/ -- Michael Biebl is now the maintainer for Debian and I suggest you link to http://packages.debian.org/upstart instead as the package won't be experimental forever.
<Keybuk> thanks
<madduck> oops
<madduck> http://upstart.ubuntu.com/
<madduck> i mean.
<madduck> you can keep me in if youw ant, i am comaintainer...
<madduck> (though i have not done much)
<Keybuk> *nods*
<AlexExtreme> Keybuk: you busy atm with uds-mtv or can I ask a quick question?
<AlexExtreme> oh, nvm, just got some of your emails on the mailing list - my mail server is a bit laggy today
<Keybuk> AlexExtreme: you can always ask questions :)
<Keybuk> I just may not reply instantly
<AlexExtreme> ok :)
<Keybuk> what was your question?
<AlexExtreme> well, just a quick (and stupid - /me points at crazy (another frugalware devel) ;)) question - will hal ever be needed by upstart?
<Keybuk> I suspect HAL will become an important source of events
<Keybuk> as unlike udev, it has policy
<Keybuk> udev can give you a "a block device has been added"
<AlexExtreme> but not actually *required*, meaning you could run upstart without it?
<Keybuk> HAL can give you "a block device ON A DIGITAL CAMERA has been added"
<Keybuk> right
<AlexExtreme> good
<Keybuk> very little of upstart will be required
<Keybuk> just the /sbin/init daemon and some IPC mechanism to send events to it
<Keybuk> other than that, everything else will be optional
<AlexExtreme> k
<AlexExtreme> crazy: there, got your question answered
<AlexExtreme> :)
<Keybuk> hmm?
<AlexExtreme> crazy wanted me to ask that
<Keybuk> ahh
<Keybuk> on the dbus thing
<Keybuk> I'm still debating the custom IPC vs. dbus thing
<AlexExtreme> ok
<AlexExtreme> bbl, food
<mbiebl> Keybuk: did you advise Md to reassign the udev problem in Debian to upstart-compat-sysv?
<Keybuk> mbiebl: yes
<Keybuk> both the problems are definitely upstart
<Keybuk> in Debian, I'd argue that you need "console owner" in the compat-sysv jobs; simply because Debian doesn't have a "no boot messages" policy, so init scripts are well within their rights to expect stdin=/dev/console
<Keybuk> also there's definitely a bug that the rcS job doesn't set RUNLEVEL or PREVLEVEL (note that rc-everything-else does :p)
<mbiebl> Sure, we don't have that policy, but that doesn't mean that it doesn't make sense to have everything logged to file instead to stdout
<Keybuk> right, but it's also inherently not a udev bug
<Keybuk> you're well within your rights to reject it
<mbiebl> ;-)
<mbiebl> The problem with console owner is, that it makes logd pretty useless.
<Keybuk> right
<Keybuk> needs improvement
<AlexExtreme> Yes, I pointed that out on upstart-devel. /var/log/boot contains nothing then
<AlexExtreme> maybe I should try improving it for something to do? ;)
<AlexExtreme> anyway, gotta go
<mbiebl> Keybuk: you know, I want to give the user the choice, if they want verbose output or not.
<Keybuk> mbiebl: *nods*
<mbiebl> So imho udev needs this "fix"
<Keybuk> md is well within his rights to refuse the fix
<mbiebl> Well, I guess I'll just ask Md to add " -o $TTY /dev/null" to his am_i_interactive check.
<Keybuk> *nods*
<Keybuk> that may be a good compromise
<Keybuk> talk to him about it
<Keybuk> Marco responds very well to conversation through medium other than the BTS
<mbiebl> hehe
<mbiebl> What about cryptsetup, how do solve that in ubuntu?
<mbiebl> exec <1>2 /dev/console ?
<mbiebl> I mean: exec </dev/console >/dev/console 2>&1?
<mbiebl> Seems a bit "hackish" to add that to a dozen of init scripts.
<mbiebl> Wouldn't it be better to have something like input/output functions, which forward the request to upstart instead of doing the input/output itself.
<mbiebl> Would something like that be possible.
<_ion> They should support a splash program as well.
<mbiebl> _ion: yes, it wouldn't matter how this information is presented.
<_ion> I don't think upstart needs to know about them, though.
<mbiebl> Keybuk: what are your top priorities for upstart in the near future?
<mbiebl> I wanted to "convert" existing init scripts and noticed that "pid file" and "multiple events" support are needed for a lot of services.
<mbiebl> I hacked together some kind of pid file support, which works most of the time.
<mbiebl> But it's rather hard to do that right.
<cortana> ugh, i thought one of the advantages of upstart is to do away with pidfiles?
<mbiebl> cortana: there are still services which don't deal well with being started in foreground.
<mbiebl> They have to be tracked somehow. Most of them write pid files.
<_ion> Use the "daemon" stanza
<mbiebl> _ion: this only works, if the "daemon" does not fork and detach.
<_ion>                 /* daemon (WS <command>)?
<_ion>                  * indicates that the process forks into the background
<_ion>                  * so we need to grovel for its process id
<mbiebl> _ion: try it, you'll see that it doesn't work for daemon's which fork
<_ion> Then it has a bug, which should be fixed.
<mbiebl> Is it even possible for upstart to determine the pid of the forked process?
<mbiebl> I dunno.
<mbiebl> How should it be done? By traversing /proc checking for a process with the same name as the binary specified in the upstart job file?
<mbiebl> Wouldn't work reliably imo.
<AlexExtreme> yeah, i mean, what if the daemon changes the process title or forks itself into multiple processes
<mbiebl> AlexExtreme: exactly.
<_ion> keybuk: Could you share your insight on the issue?
<_ion> IIRC it has something to do with pid 1 getting SIGCHLD for parentless processes.
<mbiebl> _ion: hm, ok. but take hald e.g. which spawns several sub processes.
<mbiebl> How do you know, which one is the controlling daemon.
<_ion> I haven't studied how upstart handles or is supposed to handle that.
<_ion> Let's wait for Keybuk's answer. :-)
<Keybuk> mbiebl: input/output functions are the expected way to do it
<Keybuk> then we can provide implementations that deal with console, usplash, text-to-speech, braille, etc.
<Keybuk> mbiebl: current list in my head is
<Keybuk> 1. fix the IPC stuff
<Keybuk> 2. implement the events changes we've talked about
<Keybuk> 3. multiple events, optional events
<Keybuk> 4. event completion notification
<Keybuk> 5. job changes we've talked about
<Keybuk> 6. temporal jobs
<Keybuk> 7. user jobs
<Keybuk> and, on pid location, the idea is that you spawn the daemon
<Keybuk> and then look for either the /proc/*/exe matching "pid binary"
<Keybuk> or the "pid file" file which should contain the pid
<Keybuk> we get SIGCHLD for these later
<sladen> it would certainly be more consistent if upstart does the handling of pid saving
<mbiebl> Regarding the /proc/*/exe matching: How would you handle e.g. sshd?
<mbiebl> It spawns several sub processes for each connected user and you certainly don't want to kill the wrong pid ;-)
<Keybuk> sladen: this is for processes that fork
<Keybuk> mbiebl: first one
<Keybuk> you only locate the pid once
<Keybuk> then again, sshd would be run with -D
<mbiebl> But what if you start multiple instances of a daemon.
<mbiebl> (SSH on prt 24 and 22 e.g.)
<_ion> I thought you can set both in sshd_config.
<madduck> you can
<madduck> you might want to have different settings though
<mbiebl> But I guess most daemons either write pid files are can be run properly in foreground.
<madduck> my port 22 sshd never allows root access.
<mbiebl> So this option is not that important.
<madduck> i have an sshd allowing without-password on a port that changes often
<_ion> Btw, instances of sshd spawned for logged-in users have the initial sshd as their parent.
<mbiebl> Md: hi
<Keybuk> indeed, it's only the multiple-daemon-that-pid-is-1 that's a problem
#upstart 2006-11-07
!BearPerson:*! Okay, it seems we just lost one of our hubs... we're looking into it. However, this does not look like it's caused by anything in the ircd, and it should not affect service.
!BearPerson:*! We'll be back up to full speed as soon as we can, and thank you for flying freenode!
#upstart 2006-11-08
<Fry-kun> hi there
<Keybuk> heyhey
<Fry-kun> how is it going
<Fry-kun> i'm looking for some help configuring upstart on Fedora
<Fry-kun> not specific steps but general direction tips
<Fry-kun> i've already modified the rules to point to proper locations to rc and mingetty, but rcS confuzzles me
<Fry-kun> and of course i can't boot up without it :(
<Keybuk> how does it confuzzle?
<MarvinR> hello
<Fry-kun> oh
<MarvinR> does upstart need more developers?
<Fry-kun> Fedora doesn't have one
<Fry-kun> or rather.. i don't know what it does, so i don't know if fedora has an equivalent
<Keybuk> Fry-kun: interesting, don't suppose you can paste the fedora /etc/inittab file anywhere?
<Keybuk> MarvinR: patches are always welcome
<AlexExtreme> Fry-kun: you can find out what you need from /etc/inittab - put the contents of it to some pastebin and i should be able to figure out what you need
<AlexExtreme> doh, Keybuk beat me to that one...
<Fry-kun> Keybuk: sure, just a sec
<Fry-kun> http://pastebin.com/819899
<Fry-kun> thanks guys :)
<AlexExtreme> hold on
<AlexExtreme> this should do it: http://pastebin.com/819904
<Keybuk> Fry-kun: you can probably drop rcS then
<Keybuk> and just modify rc-default to be start on startup
<AlexExtreme> no, that won't work, there's a rc.sysinit line there :)
<Keybuk> oh
<Keybuk> well write an rc-sysinit job then, and start rc-default when that stops
<Keybuk> ahh
<AlexExtreme> my rcS should do it though
<Keybuk> rc.sysinit is the same as rcS
<AlexExtreme> correct ;)
<Keybuk> si::sysinit:/etc/init.d/rcS
<Keybuk> vs.
<Keybuk> si::sysinit:/etc/rc.d/rc.sysinit
<Keybuk> so yes, AlexExtreme is right
<Fry-kun> ooh
<Fry-kun> cool, i'll try that
<AlexExtreme> bbl
<Fry-kun> gonna try booting now...
<Fry-kun> result: i was able to boot (and pretty damn fast, too) -- but didn't get a graphical shell and didn't see any boot messages
<Fry-kun> startx worked but "reboot" didn't - at least not as normal user
<Fry-kun> complained about /dev/init-something
<Fry-kun> don't have time to play with it right now, but looks promising
<tonfa> gug
<tonfa> I got a problem, probably upstart related
<phsdv> what is the problem?
<tonfa> I'm running -mm kernel, hit a bug http://lkml.org/lkml/2006/11/8/157
<tonfa> I think the the result of the bug for userspace is a segfault
<tonfa> but it looks like some things don't get started (at least gdm and hald)
<tonfa> is there a way to get some debug from upstart ?
<_ion> That looks totally not upstart related. Try booting without ACPI.
<phsdv> Are you using the sysvinit compatible layer?
<tonfa> phsdv: I'm using the default from edgy
<phsdv> that means yes. Which also means that a sysvinit runlevel is started which in its turn starts all deamons etc.
<phsdv> how to debug that I do not know. I am not using edgy myself.
<tonfa> ok, I'll try some things
<tonfa> thanks
<_ion> What made you reach the conclusion that it's probably upstart-related?
<tonfa> a lot of services are not starting, logger / hald / gdm
<_ion> Did you not just paste a log of kernel ACPI stuff crashing?
<tonfa> _ion: there's a bug in the kernel, I reported it and I know which patch are to blame
<tonfa> (see the end of the email)
<tonfa> but maybe upstart could do some things better
<tonfa> (if it's usptart related, i'm not sure)
<_ion> Are there errors in /var/log/boot?
<tonfa> _ion: let me retry
<tonfa> _ion: http://perso.ens-lyon.fr/benoit.boissinot/upload/
<tonfa> looks like upstart doesn't launch anything
<tonfa> ok it is stuck there: root      3991  0.0  0.0   1660   524 ?        S    23:01   0:00 /bin/sh -e /etc/rc2.d/S10acpid start
<tonfa> root      4123  0.2  0.0   1604   568 ?        S    23:01   0:00 modprobe -b thermal
<_ion> Not very surprising.
<_ion> ke234414 < _ion> That looks totally not upstart related. Try booting without ACPI.
<tonfa> _ion: I know how to boot this kernel, I just need to revert this patch ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.19-rc5/2.6.19-rc5-mm1/broken-out/
<tonfa> but lets say it's solved
<tonfa> thanks for the help
<Plouj> hi
<Plouj> is there an rss feed/mailing list which I can subscribe to in order to get release updates on Upstart?
<_ion> There is a mailing list.
<Plouj> I only see upstart-devel
<Plouj> I don't want a discussion mailnig list
<Plouj> mailing*
<Plouj> I want a light traffic list which would only send emails about new releases
<Plouj> is there something like that in bazzar/launchpad?
<Plouj> bazaar*
<_ion> https://launchpad.net/products/upstart shows the newest release, but there seems to be no RSS feed.
<_ion> There's also the topic of this channel. ;-)
<Plouj> well
<Plouj> I'm not gonna check this topic ever day ffs
<Plouj> the whole point of rss or email is that you get notification of everything in one place
<Plouj> I just subscribed to the main branch of upstart in launchpad
<Plouj> I've no idea what that means!
#upstart 2006-11-09
<mbiebl> Has anyone used upstart in combination with selinux?
<mbiebl> I don't use selinux myself, I was just wondering.
<ajmitch> mbiebl: yes, I have a hacked up patch for that to finish cleaning
<mbiebl> ajmitch: cool, was it much effort to add selinux support?
<mbiebl> Will you try to push the patch upstream?
<ajmitch> not much effort & yes, of course
<mbiebl> cool
<frinov> hi. trying to figure out where default runlevel is set in edgy. looking thru /etc/event.d
<matteo> can upstart handle dependencies?
<_ion> He was in a hurry.
<AlexExtreme> yeah...
<AlexExtreme> it annoys me when people do that, they don't even give you a chance to answer :/
<_ion> It's more amusing than annoying to me. :-)
<AlexExtreme> heh
<Fry-kun> ookay.. so i got the system booting..
<Fry-kun> turned out that i didn't change enough in the config files - telinit and shutdown need to point to their /usr/local/sbin/ variants
<Fry-kun> i see no major problems in /var/log/boot
<Fry-kun> but i still don't get gdm greeter :(
<AlexExtreme> hold on, i know why :)
<Fry-kun> if i log into the text terminal and run startx, it works with no problem
<AlexExtreme> you have an rc5 file, right?
<Fry-kun> yes
<Keybuk> does "runlevel" say 5 or 2?
<AlexExtreme> ok, hold on
<Fry-kun> Keybuk: booted with a standard fc5 method right now - will try next time i boot with upstart
<AlexExtreme> Fry-kun: http://pastebin.com/820508 - put that in a event.d/dm
<AlexExtreme> next time you boot you should get gdm
<Keybuk> oh, does Fedora start X from inittab?
<Fry-kun> okay, sounds good
<AlexExtreme> Keybuk: yes, frugalware does too
<AlexExtreme> it's to get it to respawn if gdm dies
<Keybuk> cool
<wasabi_> Keybuk: Your upstart stuff ever going to come up? Want to just pick some time and do it?
<wasabi_> The scheduler seems to be angry.
<Keybuk> wasabi: I appear to have a free afternoon ;)
<Keybuk> want to go over the stuff iwj did again
<Keybuk> and then talk about the job state stuff
<wasabi_> Yeah.
<wasabi_> My only booking this afternoon is some java stuff at 15:00
<wasabi_> Anytime after or before is cool.
<wasabi_> Does ian have a draft of the syntax anywhere?
<Keybuk> http://www.chiark.greenend.org.uk/~ijackson/d/upstart.text
<Keybuk> it's complete crack, of course
<wasabi_> that guy's a nut. but pretty cool.
<Keybuk> smart, but ... odd
<wasabi_> like the rest of us.
<Fry-kun> AlexExtreme: by the way, about that advice from the mailing list (to set PATH to /usr/local/sbin first).. combined with different paths for getty, rc, et.al. in various distros - wouldn't it be easier on the end users if the paths were included from some upstart config file?
<AlexExtreme> no
<AlexExtreme> the preferred way would be to have a set of job files that work with different distros (in my opinion, of course)
<wasabi_> My concern with ian's stuff is it's Very Complicated.
<wasabi_> Both to implement and for a user to understand.
<Keybuk> yeah
<Keybuk> and I think we can implements ian's stuff with /bin/sh :)
<wasabi_> Yeah. Heh.
<Keybuk> on ...
<Keybuk> script
<Keybuk>  ...
<Keybuk> end script
<Keybuk> would have the same effect
<Keybuk> we just need an "initctl wait-for"
<wasabi_> ian: "It must represent any state machine."
<wasabi_> me: "Why?"
<wasabi_> I don't think I like the idea of upstart tracking state of things on the system anyways. The idea of a simple event system is appealing.
<wasabi_> And any knowledge upstart has is out of date.
<Keybuk> indeed
<Fry-kun> Alex: but /usr/local vs / will still be there, do you want to maintain a copy for each distro for each install version? or make users change 20 files just to start the system?
<AlexExtreme> well...
<AlexExtreme> upstart is an init system, it will require some DIY, as with any other init system :)
<Fry-kun> haha
<Fry-kun> i thought ubuntu philosophy was above these issues ;)
<AlexExtreme> well
<AlexExtreme> upstart is replacing a core system component :P
<Fry-kun> that's true
<AlexExtreme> anyway don't ask me about the ubuntu philosophy, i'm not even a ubuntu user ;)
<Fry-kun> but it's not very hard to make it painless
<Fry-kun> lol ok
<Fry-kun> anyway i'll go try to boot up with my new init system
<Fry-kun> yay, it works1
<Fry-kun> takes a while after i get the tty login, but it boots up fair and square
<AlexExtreme> great :)
<Fry-kun> hope there isn't anything else that doesn't start up by itself
<Fry-kun> <.<
<Fry-kun> >.>
<Fry-kun> now the main (PITA) task - converting all services to use upstart instead of sysv
<Fry-kun> is there a set of examples somewhere? maybe even a repository of common services pre-converted
<AlexExtreme> nope
<Fry-kun> darn
<Fry-kun> oh well, more fun this way i suppose
<Fry-kun> oh yeah, it's implied of course.. but to make it explicit: Thank you, Alex!
<AlexExtreme> np :)
<Fry-kun> is it just me or did the getting-started doc change from /usr/local to /opt/upstart ?
<AlexExtreme> yes
<Fry-kun> oh good, i thought i was losing my mind
<Fry-kun> so what's the reasoning?
<AlexExtreme> no idea :)
<Fry-kun> :D
<Fry-kun> oh yeah.. so let's say I change half of my services to use upstart instead of sysv -- that means i have to remove their sysv versions (..right? or else they'll try to run 2 copies at once) -- so how do i set up the system to be able to boot using either upstart or sysv (in case upstart fails)?
-ChanServ(ChanServ@services.)- [#ubuntu]  Welcome to #ubuntu! Please read the channel topic and consider spending some time on the FAQ mentioned there
-ChanServ(ChanServ@services.)- [#ubuntu-server]  Ubuntu Server Discussions (development and support)
!alindeman:*! Hi all, a rotation server just split.  It's being removed and we're looking into it further.
!alindeman:*! As always, if you have further questions or issues, please contact an on-duty staff member ( /stats p )
<Fry-kun> found another problem - apparently the limited user can't reboot/shutdown
<_ion> Sounds more like a feature.
<Fry-kun> it complains: "shutdown: /dev/initctl : No such file or directory"
<_ion> if you mean a non-root user.
<Fry-kun> lol
<Fry-kun> yes
<_ion> There's sudo, you know?
<Keybuk> Fry-kun: wrong shutdown
<Fry-kun> in fedora, it uses a symbolic link to consolehelper
<AlexExtreme> Fry-kun: you need to use the upstart shutdown program
<Fry-kun> which in turn runs userhelper, which checks if the user is allowed to run the program
<AlexExtreme> if you installed it in /usr/local, do sudo /usr/local/sbin/shutdown
<Fry-kun> then if so, runs
<Fry-kun> X doesn't do that :P
<Fry-kun> it just runs "shutdown" - and then the system says "FU" and X goes "oh well, i'll just restart"
<Fry-kun> and starts up again
<AlexExtreme> well
<AlexExtreme> you'll have to run it yourself manually ;)
<Fry-kun> which means i have to run shutdown/reboot from a console every time X(
<Fry-kun> gee, thanks :(
<Fry-kun> there must be a better way...
<Fry-kun> man consolehelper:    "[...]  programs like /sbin/shutdown  are paired  with  a  link  from /usr/bin/shutdown to /usr/bin/consolehelper.  Then when non-root users [...]  call  the "shutdown" program, consolehelper will be invoked to authenticate the action and then invoke /sbin/shutdown.  (consolehelper itself has no priviledges; it calls the userhelper(8) program do the real work.)"
<Fry-kun> "So to make /sbin/foo or /usr/sbin/foo managed, you  need  to  create  a  link  from /usr/bin/foo to /usr/bin/consolehelper and create the file /etc/pam.d/foo, normally using the pam_console(8) PAM module"
<Fry-kun> will see if that works
<_ion> Replace /sbin/shutdown with the upstart version.
<AlexExtreme> but that'll break if he goes back to sysvinit
<_ion> Then put the original file back again.
<AlexExtreme> but he switches between the 2 ;)
<Fry-kun> when it breaks, i won't be able to
<Fry-kun> if/when
<_ion> How so?
<_ion> Just boot with init=/bin/bash
<Fry-kun> gah
<Fry-kun> but.. but... !
<Fry-kun> i was thinking to make a copy of rc.* in etc to something like rc_upstart.*, so as to make both methods work
<Fry-kun> what do you think?
<phsdv> Fry-kun, making a copy to rc_upstart.* does not change your shutdown issue, right? It is still /sbin/shutdown in X
<Fry-kun> right
<Fry-kun> but it's another issue that i'm trying to solve
<phsdv> ok, sorry
<phsdv> Fry-kun: I went to the logs, you want to be able to boot from either upstart or sysvinit, correct?
<phsdv> I do not think you have to make copies for being able to boot from both. I did not do it and I can boot from both.
<Fry-kun> the reason i want to use upstart in the first place is to be able to boot faster than i do with sysv - but if there's some problem with upstart, i don't want to lose more time than it takes for upstart to boot
<Fry-kun> in other words, i can't afford to drop into single user mode just to switch to a working configuration
#upstart 2006-11-10
<vasilis> hey,just one small question,how can i change the runlevel in upstart?
<mbiebl> Keybuk: there are problems, compiling upstart on hppa
<mbiebl> Seems, hppa does not support __thread
<mbiebl> http://experimental.ftbfs.de/fetch.php?&pkg=upstart&ver=0.2.7-1&arch=hppa&stamp=1163110346&file=log&as=raw
<mbiebl> Maybe we should abandon the usage of __thread in libnih
<_ion> ...or use them if the compiler and system supports it?
<_ion> +only
<mbiebl> or so
<Keybuk> mbiebl: hppa supports threads in feisty :p
<mbiebl> Keybuk: Does it need gcc >= 4.2 on hppa?
<Keybuk> not sure whether it's gcc or glibc
<mbiebl> I'll ask the porters, how to deal with that appropriately. Probably it's just a simple #ifdef
<Keybuk> probably
<Keybuk> just define __thread to nothing
<theCore> Keybuk, have you just presented upstart to Google folks?
<Keybuk> theCore: no, why?
<theCore> Keybuk, oh, ok. because I listened to Mark's talk and heard you talking about upstart
<theCore> or maybe it wasn't you ...
<Keybuk> it wasn't me
<Keybuk> not during Mark's talk, anyway
<theCore> it hard to tell who is speaking with VoIP :/
<theCore> ok, thanks
<Keybuk> I was talking in a little room just now
<theCore> Upstart is really becoming one the big features of Ubuntu
<thom> muh? it has the potential to do so; it doesn't actually do anything bar busting  cryptdisks yet ;-)
<theCore> thom, :)
<Keybuk> The Core was a cool movie
<Keybuk> all the annoying characters die
<mbiebl> One of the worst movies I've ever seen ;-)
<Keybuk> oh, why?
<mbiebl> Absurd story, bad effects, poor playing
<Keybuk> but it's such fun
<mbiebl> Well, if you see it from that angle, sure ;-)
* _ion laughed: "Plot Outline: The only way to save Earth from catastrophe is to drill down to the core and set it spinning again."
<Keybuk> how can you not love a film that actually called its magical element necessary for the plot "unobtanium" ?
<Keybuk> heh @ imdb
<Keybuk> # Incorrectly regarded as goofs: Since almost all of the "science" in the movie is entirely erroneous, we are prepared to accept that the movie's universe *must* have entirely different rules - it's the only possible explanation. It's just for fun.
<mbiebl> hehe, had to laught about the physics too
<theCore> Keybuk, are you making fun of my nick ? :P
<Keybuk> theCore: no
<Keybuk> I do actually like that movie
<theCore> I do too
<theCore> Keybuk, I just wondering, was it related to my nick at all?
* theCore 's brain is not super fast today ... 
<Keybuk> well, theCore; The Core
<theCore> oh
<Keybuk> my brain is low on caffeine
<theCore> once you choose a nickname, you're really stuck with it
<theCore> I would had chosen something more sane, if I had expected that passion for free software
<theCore> anyway...
<theCore> (FYI, the Core is from the game Total Annihilation, which I used to love before coming to the world of Linux)
<Keybuk> ahh
<theCore> ever heard of that game?
<theCore> you're making me remember a whole bunch of good souvenirs
<thom> TA++
<Keybuk> nope
<Keybuk> my gaming knowledge probably slightly predates yours
<Keybuk> (as my usual hostnames will attest)
<theCore> I know there is an open source implementation out there
<thom> total annihilation is probably entirely responsible for me failing my second year of uni
<theCore> thom, lol
<thom> many games went longer than 24 hours
<theCore> thom, did you ever gotten into unit creation?
<thom> nah
<theCore> me neither
<theCore> I remember that you had to script the units in COBOL
<theCore> ugh!
<theCore> thom, btw, did you ever heard about TA Spring (http://taspring.clan-sy.com)?
!christel:*! This is your captain spealing, we hit a bit of turbulence there. We're now cruising at approximately 13,000 ft. Thank you for flying freenode air and have a good day ;)
<AlexExtreme> hmm
<AlexExtreme> how would i handle critical errors in upstart jobs? i.e, if udev fails, the boot process should be stopped
<AlexExtreme> how would i do that?
<phsdv> all jobs waiting for udev/started will never start, so booting stops automatically?
<AlexExtreme> that's a point
* AlexExtreme slaps himself
<phsdv> maybe you want to start sulogin?
<AlexExtreme> that would be good
<AlexExtreme> maybe i could raise a "boot-failed" event and have sulogin start on boot-failed ?
<phsdv> yep, maybe that would help
<AlexExtreme> k
<phsdv> what about udev/failed event when a script exits with an error code. Does that exists already?
<AlexExtreme> i don't know
<AlexExtreme> Keybuk: when is the replacement-initscripts spec planned to be implemented? i mean, will it be done for feisty
<AlexExtreme> Keybuk: the reason I ask is that I think it would be better to wait for ubuntu to switch to upstart jobs, then i have some idea of the best way to do stuff. i want to know how long i'd need to wait, if you see what i mean
<mbiebl> Keybuk: hi
<Keybuk> AlexExtreme: yes, feisty
<mbiebl> Keybuk: what version of binutils do you ship in feisty?
<mbiebl> The problem with TLS on hppa seems to be a binutils issue which is said to be fixed in 2.16.8
<mbiebl> Argh, I mean 2.18
<Keybuk> mbiebl: it was fixed within the week
<mbiebl> You mean binutils?
<Keybuk>  *** 2.17.50.0.6-0ubuntu1 0
<Keybuk>         500 http://archive.ubuntu.com feisty/main Packages
<Keybuk>         100 /var/lib/dpkg/status
<mbiebl> It's likely that TLS support will be a requirement for etch+1. As far as I could find out, hppa and m68k are currently not yet ready in Debian.
<mbiebl> I was wondering, why __thread is needed at all, as upstart itself is not multithreaded.
<Keybuk> mbiebl: libnih is used by more than upstart
<mbiebl> Would you say it is safe to just remove it for upstart?
<Keybuk> can you not just patch it out?
<Keybuk> easy to make an autoconf macro for that
<mbiebl> I'm not such an autoconf guru.
<mbiebl> Would it be easy to write a test for it and check it during configure?
<Keybuk> yes
<mbiebl> Would I need a test compile for that?
<Keybuk> yeah
<Keybuk> look at AC_C_CONST for example
<Keybuk> it #defines const to nothing if it does't exist
<mbiebl> Were is that macro defined?
<mbiebl> s/Were/Where/
<theCore> Keybuk, does libnih is used elsewhere than in upstart?
<mbiebl> http://www.nabble.com/libgomp-crash-fix-t2595290.html
<mbiebl> Looks good, doesn't it?
<mbiebl> Keybuk: could you include that check directly upstream?
<Keybuk> mbiebl: yeah
<mbiebl> Keybuk: I'll prepare patches against upstart and libnih. Shall I open a LP bug report or send it to you privately?
<Keybuk> LP is fine
<Keybuk> link it to the debian one
#upstart 2006-11-11
<rudal> hi hi... is it ok to shoot a question in here?
<_ion> You already did. :-)
<rudal> lol
<rudal> :) hmm actually if that's ok with you guys,,,hmm i tried upgrading sysvinit to upstart
<rudal> using edgy ..so right now..apparnetly the machine does not come back up
<rudal> i looked around..they said that you need to use 'reboot -f' ?
<_ion> You might have packages missing.
<_ion> sudo apt-get install ubuntu-minimal ubuntu-standard
<rudal> even though I already did apt-get install upstart ?
<_ion> Upstart just starts stuff, the other upstart-related packages contain the information about stuff that should be started. Every Ubuntu system should have ubuntu-minimal and ubuntu-standard installed. For some reason for other, your system might be missing them/
<rudal> ic
<_ion> Are you able to login to the system?
<Seveas> it probably doesn't even boot
<Seveas> install the ubuntu-minimal and ubuntu-base packages
<rudal> yeah it doesnt boot :P
<rudal> hahaha
<_ion> Do you get a root prompt?
<Seveas> I hade the same during an interrupted upgrade
<rudal> not at all
<rudal> just a hang
<Seveas> _ion, without upstart-sysv-compat you get basically nothing
<Seveas> boot from a livecd, mount the harddisk, chroot into it and install the packages I mentioned
<_ion> Ok, in grub, add init=/bin/bash to the kernel parameters.
<_ion> Then, when you get a prompt, run: /etc/init.d/rcS; /etc/init.d/rc 2
<Seveas> _ion, heh, going the hard way ;)
<_ion> seveas: You mean the easy way?
<Seveas> isn't /etc/init.d/rc in the sysv-compat package?
<_ion> Then install ubuntu-minimal ubuntu-standard
<_ion> It's in sysv-rc
<Seveas> hmmm
<rudal> ohhh .. yeah currently doing an install on ubuntu-standard now
<rudal> i just used the livecd
<_ion> I'm quite sure he has sysv-rc installed.
<Seveas> yeah, that should still be there
<rudal> yeah i think so
<rudal> kk now i am installing the upstart
<rudal> k i am going to paste what i get
<rudal> The following packages were automatically installed and are no longer required: sysvinit
<_ion> When you make sure you have ubuntu-minimal and ubuntu-standard installed, you should get upstart and all the other necessary packages installed as dependencies.
<rudal> Use 'apt-get autoremove' to remove them.
<rudal> The following extra packages will be installed: startup-tasks system-services upstart upstart-compat-sysv upstart-logd
<rudal> The following packages will be REMOVED: sysvinit
<rudal> The following NEW packages will be installed: startup-tasks system-services upstart upstart-compat-sysv upstart-logd
<rudal> The following packages will be upgraded: ubuntu-minimal
<rudal> 1 upgraded, 5 newly installed, 1 to remove and 0 not upgraded.
<rudal> Need to get 171kB of archives.
<rudal> After unpacking 397kB of additional disk space will be used.
<_ion> Yes, that's looks all right.
<rudal> Do you want to continue [Y/n] ? y
<rudal> kk
<rudal> and i installed the standard alos
<rudal> *also
<_ion> (Please use pastebin the next time)
<rudal> eh? sorry what is pastebin .. sorry if I pasted too many lines
<_ion> Google for pastebin, there are many of them. Just a website where you can paste stuff to, and you get an URL for what you pasted.
<rudal> ohh ok thank you
<rudal> ahh k that works
<rudal> do you know openvz right?
<_ion> I know what it is, but haven't ever used it.
<rudal> ahh ok ok .. yeah i am trying to get upstart installed inside the edgy virtual environment
<rudal> that's why i am trying this and that..but still doesnt work on openvz .. hehe
<rudal> thank you for your help ion..i think i will trynagain sometimes tomorrow ... gonna grab some beers tonight :P
<rudal> have a great weekend !
<theCore> I think I finally found a use for upstart on my system
<theCore> I'm trying to make start a cron task only when the network is up. This task would sync my website to my hosting server.
<theCore> does upstart can replace cron, yet?
<_ion> Not yet.
<_ion> Another thing proposed for a future upstart feature is watching a directory, and running the job when its contents have changed.
<_ion> That would fit very well for mirroring scripts.
<theCore> would it possible to launch a separate cron daemon?
<_ion> Sure.
<theCore> but would it interfere with the main instance of cron/anacron?
<_ion> Uh, do you mean running two cron daemons concurrently?
<theCore> yeah, one for the system, and one for my personal network tasks
<_ion> Why not use the current crond normally, and add a network test to the beginning of the script?
<_ion> That is, test whether the network is up
<theCore> right, that should works
<theCore> I just wanted to use upstart, but it seems I will go for the old fashioned way
!christel:*! Hi all. For those of you interested in following the progress of PDPC a small news item has been added to the freenode website with information about the new PDPC board: http://freenode.net/news.shtml Have a good day.
!alindeman:*! Hi all.  We're working on getting services back up now!
<AquaFox> Do you want apple pie with thaat?
<AquaFox> Do you want apple pie with thaat?
<AquaFox> DING fries are done
<AquaFox> DING fries are done
<AquaFox> DING fries are done
<AquaFox> DING fries are done
<AquaFox> I gotta run
<AquaFox> I gotta run
<AquaFox> I gotta run
<AquaFox> I gotta run
<AlexExtreme> umm?
<AquaFox> I work at Burger King I broil whoppers I wear paper hats
<yankees26> sorry about him (i kicked him on the other channel, where i can do that :P)
<yankees26> do you guys think upstart would be a good choice for an LFS?
<AlexExtreme> yankees26: yeah, could be
<yankees26> based on what i've read on the getting-started page, it doesnt seem like it would an extreme nuisance to setup
<yankees26> (i've never actually used upstart, 'cause i dont use ubuntu)
* mode/#upstart [+o _ion]  by ChanServ
<_ion> yankees: After the proposed changes have been implemented to upstart (during the 0.3 branch), definitely yes. Currently, perhaps.
<yankees26> why's that?
<_ion> It depends on whether you need the upcoming new features or not. :-)
<_ion> See the design changes page (topic)
<yankees26> ok
<AlexExtreme> _ion: do you know if it will ever be possible to have more than one event in a job file?
<yankees26> well, i just got thoroughly confused (don't fully understand the 'on' stuff yet, etc.)
<AlexExtreme> i mean, it would be good to have all udev events in one job file, as an example
<AquaFox> http://www.americanangst.com/dingfries.html
<_ion> alexextreme: With the proposed design, something like this would be possible:
<_ion> on event0
<_ion> on event1
<_ion> pre-start script
<_ion>     case "$UPSTART_EVENT" in
<_ion>     event0)
<_ion>         ...
<_ion> etc.
<AlexExtreme> no, i mean, to define different things to do on different events, like "on event-foo, do this; on event-bar, do that"
<_ion> That's exactly what i mean.
<AlexExtreme> AquaFox: you seem bored
<AlexExtreme> ah
* AlexExtreme should read
<AlexExtreme> :P
<AquaFox> AlexExtreme, I like your analyst ways.
<AquaFox> O-Big-One-Kinobee.
<_ion> aquafox: Please behave.
<AquaFox> ?
<AquaFox> Dude.
<AquaFox> I havn't been badly behaving.
<AquaFox> I didn't insult somebody.
<AlexExtreme> you're spamming
<AquaFox> k
<AlexExtreme> gotta go, bbl
<wasabi_> so me and scott figured out the last pieces of the new design
<wasabi_> it's pretty swank
<_ion> wasabi: Were you at udsmtv?
<AlexExtreme> wasabi_: which last peices? anything interesting? :)
<wasabi_> yeah. i was there.
<wasabi_> we figured out how "levels" or whatver you want to call them will work.
<_ion> Cool.
<AlexExtreme> runlevels? nice
<wasabi_> no, not run levels.
<AlexExtreme> oh
<yankees26> AlexExtreme: do you happen to be same Alex Extreme writing FWinit (just curious)?
<AlexExtreme> FWinit was a crazy project of mine that i stopped after discovering that there were already init replacements doing what I wanted to do ;)
<yankees26> ah :P
<yankees26> wish my C skills were good enough to make some sort of work on an init system (sadly Im better at C++ and still wouldnt be as good :P)
<AlexExtreme> gotta go, night
<yankees26> night
#upstart 2006-11-12
<yankees26> night all
* mode/#upstart [-o _ion]  by _ion
<lightyear> Md are you there?
!JamesOff:*! "It's going to look pretty good, then, isn't it," said War testily, "the One Horseman and Three Pedestrians of the Apocralypse."
!Madkiss:*! Welcome pratchett.freenode.net from London, UK, EU.  Thanks to GetPro Internet Services (getpro.co.uk) for sponsoring this server! Also, please welcome James Off alias JamesOff, who will strenghten the staff-team, starting today!
!christel:*! Hi all! Apologies for the netsplit just then; it appears that one of our sponsors had a slight network hiccup. Everything should be back to normal, we hope. (And no, it was not the new guy's fault this time). Thank you for flying freenode and have a great day!
#upstart 2007-11-05
<Arafangion> Hey, why is it that when I do killall5, it also kills init, causing it to respawn?
 * Arafangion is currently booting the system for more effective troubleshooting.
<Keybuk> gotta love google
<Keybuk> "we're not doing a phone or internet device"
<Keybuk> "we're not doing a phone or internet device"
<Keybuk> "we're not doing a phone or internet device"
<Keybuk> "we'd like to announce our new phone/internet device"
<ion_> :-)
 * Keybuk has a prototype implementation of fork following now
<Keybuk> it's slightly more scary than I had hoped, but I kinda like that
<ion_> Whee
<Keybuk> our security guy is hiding from me
<Keybuk> I have given him nightmares
<Keybuk> it's written with ptrace()
<ion_> Does it have any speed implications?
<Keybuk> shouldn't think so
<Keybuk> I'm only using it to trap forks and execs
<Keybuk> (though it'll also trap signals by default)
<ion_> I added a friend request to you at facebook. :-)
<ion_> I gave in to peer pressure and joined the site today.
<Keybuk> ion_: added you
<ion_> Thanks :-)
<Jc2k> i read that out of order :-\
<Jc2k> saw something about facebook and Keybuk using it to trap something o_O
<Jc2k> :)
<Keybuk> heh
<ion_> Iâll make a fork of Upstart that uses facebook to trap forks and execs.
<Jc2k> called KylieKonnect?
<Keybuk> KylieKit
<Jc2k> lol
#upstart 2007-11-06
<AlexExtreme> Keybuk, is www,netsplit.com intentionally down? just realised my RSS hasn't been able to get to it for quite a few days now, and I can't get to it from firefox
<Keybuk> hey
<AlexExtreme> *www.netsplit.com
<Keybuk> err, not intentionally
<Keybuk> thom: ^
<AlexExtreme> netsplit.com (without the www) works fine
<Keybuk> without the www doesn't have the website
<AlexExtreme> yeah, I noticed ;)
<Keybuk> because it's a different box entirely
<AlexExtreme> aha
 * AlexExtreme wonders if upstart will compile for his OS
#upstart 2007-11-07
<tdb30_> where can I find clear documention on how to improve boot times with upstart.
#upstart 2008-11-04
<sadmac> Keybuk: where does upstart's doc format come from?
 * sadmac calculates time
<sadmac> never mind then :)
#upstart 2008-11-05
<blk> hey, i'm fiddling a bit with upstart 0.5 and i seem to be missing jobs.d, any hint what should go there - without booting is fast but useless ;)
<blk> sorry, oversaw that event.d is now init/jobs.d ;)
<blk> any reason why i shouldn't have a root directory? chdir ("/") fails with no such file or dir. -- i'm not using initramfs and init=/bin/bash works fine (there's a root=/dev/sda1 option on the kernel cmd line)
<blk> a mailing list entry suggests it's because of proc not being mounted when upstart is called - which is the case as i'm not running an initramfs before
#upstart 2008-11-06
<sadmac2> Keybuk: have time to look at the state machine prototype today?
<Keybuk> no, I haven't even got the url to it
<Keybuk> did you mail it to upstart-devel?
<sadmac2> Keybuk: I pinged it here. I'll mail it to devel if that's where you want it
<Keybuk> sure
<Keybuk> IRC is lossy ;)
<sadmac2> Keybuk: just sent
<Keybuk> thx
 * Keybuk is still insanely busy
<Keybuk> jaunty planning \o/
<Keybuk> so it's fun busy
<sadmac2> This summer, Ubuntu gets Jaunty
<sadmac2> What is it that's Jaunty? Jackalope? Jaguar?
<suihkulokki> hmm.. I have some post-lenny development plans I should write up and push to ubuntu devs too.. Shared workload and all :P
<Keybuk> Jackalope
<sadmac2> thought that was it
<Keybuk> K is proving tricky on the acronym front ;)
<Keybuk> I liked Kafkaesque :p
<sadmac2> Kafkaesque Kangaroo
<sadmac2> heh, Kafkaesque: our most depressing release yet! Fill your computer with existential horror today!
<Keybuk> not having the name is actually annoying, because jaunty is a bug fix focus release, so we're targetting features to k already
<sadmac2> Kettle-cooked
<Keybuk> I like Kinky ;)
<AlexExtreme> Kamikase Kangaroo!
<sadmac2> Ubuntu 9.04: Kinky Keybuk?
 * Keybuk gets the chains
<sadmac2> It seems strange that I'm getting paid at a time like this
<Keybuk> how so?
<sadmac2> Hmm, I dunno
<Keybuk> you mean while I'm not working on anything for you to package?
<sadmac2> I mean while you're getting the chains
<Keybuk> lol
<Keybuk> it's 6pm here, I'm on my own time ;)
<sadmac2> I have various infrastructure tasks to keep me busy whilst you're otherwise occupied
<Keybuk> also note that right now, it's not clear how much work I'll be doing on Upstart for jaunty
<Keybuk> we're planning over two releases
<Keybuk> so you may end up waiting a whole year for a 1.0
<sadmac2> Oh I think its going to take a year, definitely
<sadmac2> most of what I need from you is protocol and operating principle for the actual pid 1 service manager
<sadmac2> after that I can do most of what I need here.
<Keybuk> right, but I may not even *start* that for 6 months
<Keybuk> that's my point
<sadmac2> meh, all good
<Keybuk> depends what ends up on the jaunty list
<sadmac2> I actually might be moving positions soon
<Keybuk> I know it's kinda a bitch for you guys, but you've done it to us *so* many times ;)
<Keybuk> and at the end of the day, Ubuntu pay my salary not RH, so I do what they want :p
<sadmac2> absolutely
<Keybuk> I'm probably being a bit more pessimistic than reality right now
<Keybuk> I suspect I'll have lots of time
<Keybuk> and this time round I plan to make regular releases all through development, and keep it in a roughly working state
<Keybuk> as aposed to 0.5, where so much was stripped out, it took ages to get it working again
<sadmac2> yeah
<sadmac2> I think it'd be beneficial to look at libnih
<Keybuk> there's lots of things wrong with libnih
<sadmac2> for one of my side projects I am experimenting with a new memory model that really makes C a lot easier.
<Keybuk> oh?
<sadmac2> yeah
<Keybuk> oddly enough that's what I've been playing with recently
<sadmac2> basically you have a series of "contexts" that are all referred to by name
<Keybuk> have a prototype new nih_alloc that's based on ion_'s ideas
<sadmac2> when you allocate you specify a context to allocate into
<sadmac2> and when you free, you free everything in a context at once, never just one object
<Keybuk> isn't there a name for an allocator like that?
<Keybuk> I'm sure there's something like that in glibc
<sadmac2> Its quasi region based
<sadmac2> but the idea is you allocate by the time period an object is relevant for
<Keybuk> it's a bit like obstack
<sadmac2> so for this web server dealie: theres a context for transactions (opened on a request, closed on reply), a context for the time between receiving the start of a header and receiving the start of the entity, a context between the open and close of the connection, etc.
<sadmac2> you get a lot of performance gains too, because the allocation operations are simpler, and the free operations are infrequent and much simpler
<Keybuk> are you sure you've not just reinvented an alternate API to obstack? :p
<Keybuk> obstacks are simple, for each obstack you can allocate as many items as you want
<sadmac2> let me see...
<Keybuk> when you free an item, all items allocated *after* that item are also freed
<Keybuk> freeing the first item clears the obstack
<Keybuk> they're really useful for exactly what you describe
<Keybuk> attach an obstack to the transaction
<Keybuk> allocate everything from there, including header stuff
<Keybuk> each time you finish a header parse, free the item that started it (everything allocated for the header goes too)
<Keybuk> each time you finish a transaction, free the obstack
<sadmac2> that's good to know :)
<sadmac2> I think most allocation should work that way.
<sadmac2> the one thing I did different is most/all of the stacks are globally accessable.
<Keybuk> the really nice thing about obstacks is they have a sort of memory
<Keybuk> so if you repeatedly do the header phrase, there won't be any actual malloc() or free() calls
<Keybuk> since you'll just continually reuse the same bit
<sadmac2> yes. this is good :)
<sadmac2> why are there no manpages for it?
<Keybuk> because it's in glibc
<Keybuk> read the info docs :p
<sadmac2> friggin gnu freaky manpages
<sadmac2> granted, info is superior to man in most every way...
<sadmac2> but who has time for this shit?
<sadmac2> Keybuk: please note the mailing list post I just made.
<ion_> tl;dr
<ion_> Nah, just kidding. Iâll try to read it. :-)
<sadmac> heh
#upstart 2009-11-02
<spgle> Hello, anyone having a patch on source for bug https://bugs.launchpad.net/upstart/+bug/252997 (process not respawning) for upstart 0.3.x ? I've seen some elements for 0.5.x but not for older releases. I would like to upgrade a FC9 upstart package with more robust respawn behaviour. TY.
#upstart 2009-11-03
<snikker> hi, the ols script in "/etc/init.c/" work also with upstart without any conversion?
<snikker> *old
<snikker> i mean, how what i do for get my old init script to work with upstart?
<omani> lol
<wasabi> snikker, your old init scripts don't work with upstart directly. Upstart does however implement sysv startup.
<wasabi> Through the rc* scripts in /etc/init
<wasabi> The rc system still runs.
<snikker> wasabi: oh, ok i'm under ubuntu and i'd like convert my init scripts (/etc/init.d) for upstart 
<wasabi> Go for it.
<wasabi> Folks, do we have a page outlining the current upstart structure in Ubuntu? Common events, common jobs, time periods, etc?
 * keesj discovers upstart-udev-bridge
#upstart 2009-11-05
<wanderer_> hi. Ubuntu9.10 question: anyone can explain why symbolic link in /etc/init/ is not recognized by upstart as valid job?
<wanderer_> evand:did not really help
<twiinz> hi there, is it possible to have a single upstart .conf file that exec multiple scripts (basically the same script but with different parameters) and also set the respawn setting on each of them ?
<wasabi> twiinz, there is an instance thing.
<wasabi> not sure if that's what you're thinking of
<twiinz> wasabi: instance? that sounds interesting
<wasabi> man 5 init
<wasabi> Keybuk, it's really awesome to see all this stuff we talked about live.
<wasabi> congrats
<twiinz> wow wasabi this looks very promising, reading about it
<wasabi> Hmm. DKMS needs to run before GDM.
<wasabi> Sucks rebooting into a new kernel without nvidia built. :0
<mbiebl> Keybuk: bzr branch lp:upstart
<mbiebl> bzr: ERROR: Not a branch: "http://bazaar.launchpad.net/~scott/upstart/trunk/".
<Keybuk> mbiebl: what version of bzr?
<Keybuk> bah, regression/change with automake 1.11
<Keybuk> make dist doesn't work anymore
<mbiebl> Keybuk: 2.0.2-1
<mbiebl> hm, now magically fixed again :-)
<Keybuk> mbiebl: probably caught LP at a bad Time
<adurity> I'd like to run a script based on the presence of certain hardware at boot.  Can upstart help me do this today?
<mbiebl> adurity: yes
<adurity> mbiebl, how?
<mbiebl> If you use ubuntu 9.10, there is a already a tool called upstart-udev-bridge
<mbiebl> which generates upstart events based on information from udev
<mbiebl> If you don't have that tool, you can write your own udev rules
<mbiebl> and emit events use initctl emit
<mbiebl> and start your upstart based on those events
<adurity> i have upstart-udev-bridge
<adurity> how do I know which events to listen to for specific hardware?
<mbiebl> my best answer to this is, read the source
<mbiebl> apt-get source upstart
<mbiebl> -> udev/upstart-udev-bridge.c
<mbiebl> there you can read, how the events are named
<adurity> alright, thanks, I'll go source diving
<Keybuk> $SUBSYSTEM-device-$ACTIONed
<Keybuk> :)
<Keybuk> it's a hack though, and will change in backwardly incompatible ways
#upstart 2009-11-06
<SteveG> In an /etc/init/*.conf file can you specify to upstart to "start on driver load"?
<SteveG> I am having an issue where the template says "start on (local-filesystems and net-device-up IFACE=lo)" but the application this spawns still needs a driver to have been loaded or it will not see the hardware.
<SteveG> What is the best resource for learning about writing "start on" and "stop on" statements?  I want to start a service after a driver loads.
<Keybuk> start with "man upstart" ?
<Keybuk> robbiew: your charts look normal?
<Keybuk> robbiew: it's a hard drive, not an SSD right?
<robbiew> right
<Keybuk> right
<Keybuk> so your chart is normal
<Keybuk> it isn't profiling, it's reading
<robbiew> hmm
<Keybuk> what were the charts like before?
<robbiew> let me send
<Keybuk> so it's 20s better now? :p
<Keybuk> if not more
<Keybuk> on hard drives, because there's such a penalty for seek, ureadahead remains in the foreground
<Keybuk> that way it can basically read the entire page cache in one scan across the disk
<Keybuk> which is why you're getting 113 MB/s out of it
<rpolak> Hello
<rpolak> I'm trying to figure out how upstart is initing ntp in Ubuntu 9.10
<mbiebl> rpolak: the ntpd daemon?
<rpolak> Yeah,  I can't find where in the world it's initing from
<mbiebl> I think it's started by a sysv init script
<rpolak> I've been chasing this new fricking upstart down a rabbit hole
<rpolak> How are the sysv scipts being called by upstart
<mbiebl> rpolak: there is an upstart job called /etc/init/rc.conf
<mbiebl> which read the default runlevel from /etc/inittab, and then runs "/etc/init/rc $runlevel"
<mbiebl> which in turn runs the legacy sysv init scripts
<rpolak> A ha
<rpolak> however I don't have a symlnk in any of the /etc/rc*.d dirs
<mbiebl> rpolak: sorry, I meant /etc/init.d/rc (note the .d)
<mbiebl> and there is no /etc/rc*.d/ in Debian/Ubuntu
<rpolak> ls -lah
<rpolak> ./rc2.d/K20ntp
<rpolak> that got it to stop
<mbiebl> argh, I'm talking rubbish atm. of course there is /etc/rc?.d/, there is no /etc/rc.d/
<mbiebl> rpolak: seems you have disable ntp for runlevel 2
<mbiebl> rename that to S20ntp
<rpolak> I knew my eyes weren't decieving me
<mbiebl> and you are fine
<rpolak> I wanted it to stop loading
<rpolak> I'm having trouble with the time skew being to large to be corrected by the deamon while running Ubuntu under VirtualBox
<mbiebl> so, if you already found how to disable ntp, what is your question again?
<rpolak> I just figured it out while I was talking with you
<rpolak> However, if you could explain how it was initing without a S* in /etc/rc2.d I would appreciate it
<mbiebl> It will no longer be started by default if you boot into runlevel 2
<rpolak> I am at this point interested in understanding the behavior of upstart in that normally with init it would start only processes with a /etc/rc?.d/S?deamon symlink
<mbiebl> that is not quite correct
<mbiebl> old sysvinit starts the processes listed in /etc/inittab
<mbiebl> And it's the task of sysv-rc (providing /etc/init.d/rc) to start the services in /etc/rc?.d/
<rpolak> Ok, So by what mechanism was ntpd starting with upstart on this Ubuntu 9.10 machine
<ion> ntp isnât handled by Upstart in 9.10.
<mbiebl> rpolak: as I told you
<mbiebl> it's still a sysv init script
<rpolak> a better question than would be where in upstart is the runlevel for the legacy rc set
<mbiebl> rpolak: check /etc/init/rc-sysinit.conf
<rpolak> I see
<rpolak> Thank you for shedding some light on this for me
<mbiebl> np
<Keybuk> (man runlevel would have answered the question too :p)
#upstart 2009-11-08
<superm1> hey guys, re bug 453365, what's the best way to represent Anders' last reply?  
<superm1> ( https://bugs.launchpad.net/bugs/453365 )
<Keybuk> superm1: Anders is correct
<Keybuk> if you only start when a display manager is started, then it won't get started on server
<sadmac_> Keybuk: appart from added stanzas and not being able to repeat start/stop stanzas whats different about 0.6 job syntax from 0.3?
<Keybuk> sadmac_home: service is the default
<sadmac_home> Keybuk: cool
<sadmac_home> Keybuk: I'm going to try to patch 0.6 to parse 0.3 style syntax out of /etc/event.d. It should be trivial, and it would go a long way to getting rid of 0.3 in RH stuff
<Keybuk> I thought you guys were sticking until after RHEL was out
<sadmac_home> Keybuk: I might be able to squeeze it in in a minor release if it doesn't break config format
<Keybuk> you're not subscribing to the LF/LWN bitching then? :p
<sadmac_home> Keybuk: has there been bitching?
<sadmac_home> Keybuk: from who? about what?
<Keybuk> oh, apparently RedHat would never sign the copyright assignment
<Keybuk> and are forking Upstart
<Keybuk> or was that SuSE forking Upstart?
<sadmac_home> Keybuk: ...this is not true
<Keybuk> and the Linux Foundation are throwing Canonical out for having it
<Keybuk> you know how it is
<sadmac_home> Keybuk: granted, we hate you for your stupid copyright assignment, but when we have to play ball...
<ion> Forking Upstart? Thatâs sad.
<Keybuk> ion: you've met Lennart right? :p
<ion> :-D
<sadmac_home> I may fork pulseaudio, just to watch it languish and die
<ion> Not actually, but i do know of him.
<Keybuk> sadmac_home: it's a bit of a long story
<Keybuk> but we've done some detective work
<Keybuk> it seems that SuSE were going to adopt Upstart
<Keybuk> and their lawyers threw a tizzy about the copyright assignment
<Keybuk> (ironic, since it was pretty much based on their Mono one <g>)
<ion> Hah
<Keybuk> Greg KH then led an anti-Canonical tirade over beers in the pub
<Keybuk> various RH people were there, including Lennart
<Keybuk> and various SuSE people
<superm1> Keybuk, but what kind of results would be expected by having an "or  (starting rc RUNLEVEL[2345])"?  does that mean that the that starting gdm etc would be ignored?
<Keybuk> which led to the LF Technical Advisory Board officially deciding it was a problem
<Keybuk> superm1: it means that the first one to start wins
<ion> (Oh, wait, i *have* met him briefly on IRC.)
<ion> keybuk: When will 0.10 be out, btw? ;-)
<Keybuk> ion: err when I start it + some time
<Keybuk> got distracted with all those mountall issues
<Keybuk> and then distracted by ureadahead <g>
<ion> Heh
<superm1> Keybuk, Hm, so then maybe the ideal situation would be an "or (starting rc RUNLEVEL[5])",?  or are all the old rc runlevels still going in parallel with upstart jobs?
<sadmac_home> I have that new conf parser written mostly. A bit burnt out now :)
<sadmac_home> hence going back to patching 0.6. Need to not work on that for a bit while my brain heals.
<Keybuk> superm1: I'm not raelly following, sorry
<Keybuk> ask me when it's not Sunday evening and I'm not watching DS9, and when I haven't had a few drinks <g>
<superm1> alrighty, i'll ping ya some time during the week after i can even make sure that the current proposed solution DTRT in the first place for desktop systems
<Keybuk> are you coming to Dallas?
<superm1> Yeah, but not until Tuesday
<sadmac_home> what's in Dallas?
<Keybuk> sadmac_home: this UDS
<sadmac_home> Keybuk: o wow
<sadmac_home> Keybuk: you + dallas = :''(
<Keybuk> why :''( ?
<sadmac_home> Keybuk: you're just very un-Texan
<Keybuk> but, but
<Keybuk> I'm going to get me a cowboy!
<sadmac_home> Keybuk: getting you a cowboy isn't legal in Texas :P
<sadmac_home> Keybuk: though that really doesn't stop anybody
<Keybuk> sadmac_home: we can run for the border
<Keybuk> in an open-topped american muscle car!
<Keybuk> I've seen the movies!
<sadmac_home> Keybuk: you shouldn't let the movies color your views of Americans
<sadmac_home> Keybuk: if I'd let deliverance color my views of gay people It'd be a very sad thing :(
<Keybuk> haha
<Keybuk> do you know, I've never seen that film
<sadmac_home> Keybuk: I was young, so I saw everything leading up to and following the famous scene.
<sadmac_home> Keybuk: I think "squeal like a pig" paints me a pretty good image of the missing bit though.
<robbiew_> FYI - Deliverance wasn't in Texas...not even the same region of the US
<Keybuk> surely that colours your view of Rednecks? :p
<sadmac_home> robbiew_: did we imply such?
<sadmac_home> Keybuk: I'm on a first name basis with too many rednecks for my views to be colored
<sadmac_home> Keybuk: too many gays too, though most of them are furries so that in itself probably colors things a bit.
<robbiew_> rednecks are also different from hillbillies...which was deliverance ;)
<robbiew_> I stay away from both if at all possible
<sadmac_home> rednecks are good people.
<sadmac_home> except when they dip snuff. that's the grossest habbit I've ever seen
<robbiew_> or tie black people to the back of their trucks and drag them until the head comes off ;)
<Keybuk> robbiew_: hey, at least you get the truck :-)
<sadmac_home> robbiew_: most of the rednecks I know are fairly racially modernized
<robbiew_> heh..that's nice
<sadmac_home> Keybuk: didn't debian formally adopt upstart? Doesn't that make upstart.ubuntu.com out of date?
<Keybuk> sadmac_home: it's Debian
<Keybuk> time from decision to implementation can be measured in ecological scales
<sadmac_home> Keybuk: ah
<Keybuk> I think officially the Debian sysvinit maintainer is waiting for the Debian upstart maintainer to implement a few backwards compatibility shims
<Keybuk> mbiebl: how are those going?
#upstart 2010-11-09
<twb> I have a diskless/netboot Ubuntu 10.04 thin client.  I want to use kexec, a kernel feature that allows you to reboot without passing through the BIOS.  Ubuntu 10.04's kexec-tools package uses rc6.d, and it isn't working.
<twb> I'm trying to work out which event signals the "end" of the reboot sequence, so that I can run "kexec -e" at that time.
<twb> OK, that's odd... it looks like the ACTUAL reboot is done in rc6.d still in 10.04.
<twb> ARGH, I missed that kexec-tools disables itself by default in /etc/default/kexec.
<twb> Works now
<twb> Thanks.
<christophe> Hi ! We have a personal upstart job which run a script, everythink is ok at startup by at shutdown [pre|post]-stop didn't wait for the script to finish .. is there a way to change this behaviour ?
<christophe> anybody ?
#upstart 2010-11-10
<seanpaul> Hi all. I'm trying to debug a startup issue with upstart. It seems to hang on nih_watch_new in conf_source_reload_file (init/conf.c). I'm wondering whether one of you might have come across this before. I'm using a custom 2.6.36 kernel, so maybe one of the CONFIG values is incorrectly set?
<Keybuk> run "make check"
<Keybuk> does the test suite pass?
<ericholscher> Is there no way to tell upstart which PID to monitor?
<Keybuk> upstart monitors the PID it spawned itself
#upstart 2010-11-12
<Shred00> does upstart's init ever periodically "wait" to reap zombies it might have inherited?  if not, can i force it to wait on a zombie that it inherited?
<Keybuk> upstart just calls wait() every time through the main loop
<Keybuk> and since it gets a SIGCHLD whenever it inherits a zombie, it's guaranteed to wake that up and call wait()
<Shred00> hrm.  well, it doesn't seem to be reaping this one:
<Shred00> brian    24701     1  5 Nov11 pts/16   01:39:46 [evolution] <defunct>
<Shred00> oh wait.  looking at dmesg it seems that process triggered a kernel bug.  ~sigh~
#upstart 2010-11-13
<terrycojones> hi.
<terrycojones> i'm trying to get upstart to start a process for me (running 10.04) and it's frustratingly silent when things don't work out. is there a way to get it to produce more output? i've looked in /var/log/daemon.log and /var/log/syslog, but there's nothing there......   thanks!
#upstart 2011-11-07
<broder> how do people generate the git-send-email-like messages that go to upstart-devel? by hand? bzr-send doesn't seem to want to write them in that style...
#upstart 2011-11-09
<twb> For lucid, is this the right way to do multiple instances?  http://paste.debian.net/144039/
<twb> How the hell do you get a list of all active instances of a job
<broder> twb: initctl list will print out all active instances
<twb> Ah, OK, and then grep my job name out of that
<twb> Yeah initctl list | sed -rn 's/^network-interface \((.*)\).*/\1/p'
<twb> initctl list | sed -rn 's/^network-interface \((.*)\).*/\1/p' | while read url do stop streamripper URL=$url done
<lericson> Guys, seriously -- is "Job failed to start" the best diagnostics message I can get?
<lericson> I'll tell you what, it does not suffice.
<lericson> Also, can I get the instance identifier (i.e. `instance $X/$Y` I want a variable containing "$X/$Y", potentially named $INSTANCE? I would TIAS but it's impossible to diagnostice errors.)
<ion> As init(5) says, UPSTART_INSTANCE.
<ion> Anything in syslog? If not, make your scripts log something.
<lericson> Nov  9 10:12:02 localhost init: gunicorn (julkort/julkort:app) pre-start process (32452) terminated with status 1
<lericson> It says
<lericson> Which is a little better I agree, but I want the stderr output
<ion> pre-start script
<ion>   exec >>/tmp/foo 2>&1
<ion>   â¦
<jhunt> lericson: http://upstart.ubuntu.com/cookbook/#debugging
<jhunt> lericson: Have you checked your job with init-checkconf (http://upstart.ubuntu.com/cookbook/#init-checkconf)? Also, you may be affected by "set -e". Read this snippet for details: http://upstart.ubuntu.com/cookbook/#debugging-a-script-which-appears-to-be-behaving-oddly
<lericson> Ah, thanks -- seems my pre-start script wasn't to its liking, will look into later.
<lericson> But now I get this weird behavior, inictl list says:
<lericson> gunicorn (julkort/julkort:app) start/running
<lericson> Yet the process is dead, and the syslog says "main process ended, respawning" twice with one second in between
<lericson> I'd expect it to respawn it 10 times within 15 seconds?
<lericson> Or does it somehow consider it running?
<lericson> (It would seem to be the case given the list output.)
<ion> Add similar logging to the main process and see why it dies immediately.
<lericson> jhunt: And I don't have init-checkconf on this server, no idea how to get it either.
<jhunt> lericson: sounds like you're running lucid?
<lericson> ion: It dies immediately because I told it to, but I want to know why Upstart isn't doing as advertised (respawning is a major point)
<lericson> jhunt: Yes, LTS
<jhunt> lericson: do this then - http://upstart.ubuntu.com/cookbook/#older-versions-of-upstart
<lericson> Thank you! I give you two 5/5 in friendliness, expertise and professionalism-- feels like customer support.
<jhunt> lericson: I'd guess you hadn't told it to respawn. If you have a service you want to respawn, you need to add the "respawn" stanza to your .conf file (see "man 5 init" for details).
<lericson> I like the idea of Upstart by the way, I was a Gentooist for the longest time but I think Upstart > OpenRC
<lericson> I did, jhunt
<ion> Please paste your job definition and the relevant lines from syslog.
<lericson> Relevant might be that the service daemonizes itself (I do have expect fork)
<ion> Are you sure the service forks exactly once?
<jhunt> lericson: when you say "daemonizes", do you mean that? If so, you need to specify "expect daemon" (2 forks) rather than "expect fork" (1 fork)
<jhunt> lericson: this is a known problem - if you don't know how many times your app forks and mis-specify it, Upstart is unable to "track" the pid so you can get odd behaviour. We intend to fix this issue for the next LTS (it's a difficult problem to address).
<lericson> http://pb.lericson.se/p/SBiMze/
<lericson> I know, jhunt -- I haven't read gunicorn's source lately, so I don't know, but I would guess they don't daemonize properly.
<lericson> But you're saying this is a symptom of it losing the PID?
<jhunt> lericson: quite possibly. I'd recommend running "strace -fFv -o /tmp/strace.log /usr/bin/gunicorn ..." and grepping for fork/clone calls in /tmp/strace.log.
<lericson> Also by the way, my pre-start script seems to check out fine.
<ion> It may be simpler just to tell the main process not to daemonize and drop the âexpectâ stanza.
<lericson> Well, interestingly http://gunicorn.org/faq.html#gunicorn-fails-to-start-with-upstart
<jhunt> lericson: also, your "stop on" looks wrong - there is no standard "shutdown" event on Lucid. You generally specify "stop on runlevel [016]" (ie stop on halt/single-user mode/reboot).
<lericson> Oh, I ripped that off of mysql
<lericson> No, I didn't.
<lericson> I got it somewhere anyway
<lericson> So now initctl stop blah just sits there, apparently doing nothing.
<lericson> syslog is empty
<ion> I take it initctl status says âstop/runningâ for the job?
<lericson> ^C'd it and it says gunicorn (julkort/julkort:app) stop/killed, process 32572
<ion> ah, stop/killed indeed.
<ion> Another symptom of lying to Upstart about the forking behavior of the main process. :-) Run workaround-upstart-snafu 32572. http://heh.fi/tmp/workaround-upstart-snafu
<jhunt> I'd recomment: (1) killing the pid of your gunicorn process manually, then (2) retrying the "stop". Then, (3) comment out "respawn" and "expect fork" and starting the job. If the reported pid is correct, gunicorn isn't forking at all and you can then just re-enable the respawn.
<jhunt> If the pid is wrong, stop the job again (kill + stop), and try adding "expect daemon".
<lericson> ion: It forks until it gets the same pid and then dies? :|
<ion> yeah
<jhunt> The maximum number of forks an app will do is 2 (there is no benefit doing more)
<lericson> jhunt: It's dead already, not even a zombie process
<lericson> Out of curiosity, how does it track forks?
<jhunt> so does "gunicorn --daemon" coupled with "expect daemon" work for you?
<jhunt> lericson: it uses ptrace
<lericson> jhunt: I don't know, I can't even get it to start again.
<lericson> Haven't tried ion's workaround (no ruby)
<jhunt> lericson: We will be making some improvements to the tracking this cycle and may start using cgroups at a later stage. However, 99% of apps can be handled via ptrace.
<ion> When status says stop/killed with an inexistent process, Upstart is in a confused state, perpetually expecting to receive a SIGCHLD for a process with that PID. The workaround provides such a process. :-P
<ion> jhunt: cgroups, huh? Didnât Keybuk come up with a proc connector implementation much superior to a cgroups implementation? Thereâs even a working prototype.
<lericson> Can't I restart the daemon? >_>
<jhunt> ion: Keybuk and I discussed both options recently. The proc connector has issues.
<ion> ok
<jhunt> ion: specifically wrt containerized environments
<ion> Is there a fix for the cgroups issues?
<jhunt> lericson: unfortunately, if the pid being reported by upstart no longer exists, nominally you'll have to reboot to clear Upstarts knowledge of that job. If you're on a dev box, just copy your .conf file to a new name and work with that newly named job for the meantime.
<ion> (or use workaround-upstart-snafu)
<lericson> So quite predictably, running a tool that is essentially a fork bomb fork bombed the machine
<ion> Itâs not a fork bomb.
<jhunt> lericson: seems that gunicorn doesn't fork at all by default.
<lericson> jhunt: No, but it wants to
<jhunt> lericson: hence, you don't need "expect" at all.
<lericson> As linked above, their FAQ explicitly says "use --daemon"
<jhunt> lericson: have you checked your gunicorn config file (daemon=False|True)?
<ion> The script has no more than three processes at any time.
<lericson> jhunt: I did, and the reason Upstart got confused is me
<lericson> However I'm more focused on fixing the issue than placing blame :-)
<jhunt> lericson: so, any joy with copying the .conf file and modifying it?
<lericson> I'm going with that approach yeah, thanks for the tip-- other question: $UPSTART_INSTANCE expands to $UPSTART_INSTANCE (or rather doesn't expand at all) in my exec line
<lericson> Ah, mystery is solved; I had expect fork but Gunicorn does proper daemonization https://github.com/benoitc/gunicorn/blob/master/gunicorn/util.py#L280
<jhunt> lericson: I thought we'd already come to that conclusion :)
<jhunt> so you should be able to run gunicorn without --daemon and without the "expect" stanza, or with --daemon and "expect daemon". If one/both of these work, I'd appreaciate it if you could let the gunicorn people know so they can update their faq (and maybe provide a "debian/gunicorn.upstart" in their distribution files)
<lericson> jhunt: I'll be contributing this upstart script to gunicorn most likely, and yes it does work as intended with --daemon and expect daemon
<lericson> Which seems pretty obvious now that I say it, but hey
<jhunt> lericson: great - thanks very much!!
<lericson> BTW, OpenRC has this /etc/init.d/foo zap command which is extremely useful in situations like these as I am sure you're aware, is this avoided on a philosophical basis or just not implemented?
<jhunt> jhunt: I'll update the cookbook with a section on how to identify which stanzas you need for daemons of various types hopefully this week...
<jhunt> lericson: well, historically "both", but we do intend to resolve this issue in the current cycle. Since Upstart now supports user jobs, being able to kill a mis-specified user job is particularly important as user jobs can be used as a testing ground for system jobs.
<lericson> ISTM a lot of things can make Startup get stuck, nginx has the same issue.
<lericson> So the same freeze effect happens if the post-stop script fails?
<lericson> Hey, nevermind
<lericson> Turns out it doesn't freeze
<jhunt> lericson: it can be tricky to write a new .conf file, particularly when it isn't obvious what the daemon is actually doing. However, once Upstart knows how to establish the pid of your job, you're in good hands :)
<lericson> (-:
<lericson> It occurred to me that you can't really expand variables in the `exec` line, is this true?
<lericson> Or rather they need to be isolated somehow?
<jhunt> lericson: expansion should work fine. Maybe you've somehow got some unicode dollar/underscores in the original version of your .conf file?
<lericson> jhunt: It was in the env lines
<jhunt> lericson: aha!
<lericson> So how does one restart a service with Upstart?
<lericson> initctl restart <job>
<lericson> Ok, thanks.
<lericson> Does this first stop the job and the start it again, or how does it work?
<jY> yes that's how it works
<lericson> So, is there a way to add a reload event? I was thinking along the lines of initctl emit reload JOB=nginx
<lericson> Hmmmm
<SpamapS> lericson: restart stops and starts the job without reloading the job config
<SpamapS> lericson: initctl reload will tell upstart to send SIGHUP to the tracked process
<lericson> SpamapS: The daemon I'm writing the script cycles PID on HUP.
<lericson> So I have a task without an exec or script section, only post-start and post-stop. It is meant to start a set of services on boot
<lericson> The problem is that it does nothing.
<lericson> In fact starting it just makes initctl stop
<SpamapS> lericson: yeah, you have to use stop/start for that
<SpamapS> I actually don't like restart for most operations. :-/
<lericson> I think it's a mistake assuming all daemons reload with SIGHUP without changing, and that it is a mistake assuming that all daemons best restart via stop + start.
<codebeaker> lericson: I think there's a missing pardigm [:start, :stop, :restart (stop, something else?, :start), :reload]
<codebeaker> ^ would fit the way daemons actually need to work
<lericson> on reload exec nginx -s reload
<lericson> make it go!
<codebeaker> ^ lericson ?
<codebeaker> is that valid "on reload â¦â¦â¦â¦"
<codebeaker> ?
<lericson> Nope, but that's what I want.
<codebeaker> ^ right :)
<SpamapS> You can change the kill signal now... but I don't think you can change the reload signal. :-P
<SpamapS> lericson: its not meant to do all service orchestration for you. Its meant to facilitate starting and stopping of services. You can write a script to do complex interactions like that.
<SpamapS> I agree that assuming behaviors of tracked daemons causes as many problems as it solves.
<codebeaker> SpamapS: HUP certainly wasn't designed historically to tell a process to RELOAD
<SpamapS> indeed, it just became a convention of nearly every daemon ;)
<SpamapS> since daemons, by definition, do not have a terminal, "the terminal hung up" isn't meaningful for them in its original context
<codebeaker> that's a point I hadn't considered
<codebeaker> but, what's stopping people inventing new signals ?
<codebeaker> (theoretically?)
<lericson> Standardization across platforms
<codebeaker> sure, but upstart introduced an arbitrary signaling interface, did it not ?
<codebeaker> or, "Eventing" rather
#upstart 2011-11-13
<ion> It seems a child process of my âstop on runlevel [!2345]â job on 10.04 gets killed by sysv killprocs while my job is still terminating it gracefully. I wonder what to do to make killprocs wait for it?
<ion> https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/545412
#upstart 2012-11-05
<viric> JanC: I found that upstart deadlock to be an issue in readdir()
<viric> JanC: http://www.linux-mips.org/archives/linux-mips/2012-11/msg00028.html
<jodh> viric: I haven't seen that issue, but please also see: http://upstart.ubuntu.com/cookbook/#symbolic-links-don-t-work-in-etc-init
<viric> meh
<viric> jodh: all links can be followed :) we use that since early upstart, and still, in all platforms other than mips. Well, also in mips, but it stopped working at linux 3.5.
<viric> (stopped working only for mips)
<viric> nevertheless, thank you for that link!
<viric> I didn't know there was a problem about that.
<jodh> viric: it's also documented in init(5).
<viric> well, we take it as "our job" for symlinks to resolve. We don't expect upstart to do anything good in case they don't resolve.
<viric> no blame for upstart. :)
<viric> And in the mips issue.... clearly I tracked down the problem inside libnih, in its call to readdir(). And I could reproduce it out of libnih and out of upstart.
<jodh> yes, thank you for investigating this issue!
<viric> ah, you are welcome :) Let's say that I'd like my system to boot. hehe
<viric> But I don't see any response in linuxmips.
#upstart 2012-11-06
<aconbere> hey, I'm having an issue running a java service under upstart, that runs fine from the shell
<aconbere> I can run it in the shell with the same privs
<aconbere> and it takes no options
<aconbere> and doesn't inspect any environmental variables
<aconbere> I don't know how to debug this
<aconbere> wondering if anyone here can help
<aconbere> (the error for reference is reading a datafile out of a jar, i get a MalformedInputException, but only in upstart)
<aconbere> my theories run the gambit of some strange forking going on
<aconbere> or maybe just running in a different environment
<SpamapS> aconbere: java shouldn't be forking
<dan2003> Hi, im trying to make a script to run a task when mysql is stopped. But im having the problem that it takes a while it doesnt get to copmlete before reboot or halt, so I tried setting the kill timeout to a value greater than the default (5). But it doesnt help. I have realised that this is probably because I did not have a stop in statement. But I am not able to find a suitable event for my stop on statement, an ideas?
<dan2003> stop in/stop on
<dan2003> I was just about to add i have tried the obvious runlevel [06] and found it dodnt work presumeably becasue that happens before my process is even started, but am trying it again as think i may have had a syntax error
<jodh> dan2003: currently, having a job start on shutdown is going to be challenging. You may need to look at /etc/init.d/sendsigs and /etc/init.d/umountroot since those are invoked just before shutdown and you may need to modify them to ensure they wait for your job(s) to complete.
<dan2003> jodh, ok, I am jut trying a bit of a hack with a seperate job that starts on runlevel [06] and has kil timeout 60, and stops on stop stopped my_other_job, which will be omitted when the other job is done
<dan2003> but if this fails I will look at that
<jodh> dan2003: the problem is that the final shutdown stages on Ubuntu are not currently handled directly by Upstart - we're looking to change that behaviour in the Raring cycle.
<dan2003> oh ok
<dan2003> jodh, thanks a bunch, a simple check in  /etc/init.d/sendsigs seems to have resolved my problem
<jodh> dan2003: np :)
<aconbere> hey, I've got a little project I'm using that makes use of scalate. To deploy my app, I package a jar and ship it off to servers. I'm unclear how to make use of scalate templates once they're packaged though...
<aconbere> I think my best bet is precompiling them, but then there's not really any discussion in the docs of accessing precompiled templates
<aconbere> anyway, if anyone knows anything about that (or a better place to look)
<aconbere> bah, wrong channel
<aconbere> :-/
#upstart 2012-11-07
<mrvn> what do I do if a job is start/killed? I can neigther start nor stop it anymore.
<SpamapS> jodh: ^^ any chance that bug is on the TODO for this cycle?
<jodh> SpamapS: we'll try, but the priority this cycle is going to be enhanced user sessions.
<benzittlau> I was hoping somewhere here might be able to help me out
<benzittlau> I have an upstart script which is in an semi-crashed state that I can't seem to recover from
<benzittlau> if I call status <script_name> it tells me its in start/running, but with a PID that is already dead
<benzittlau> I can't stop it, I can't start it.  I can't seem to get it out of this state
<SpamapS> benzittlau: https://bugs.launchpad.net/upstart/+bug/406397
<SpamapS> benzittlau: there are some workarounds in the comments
#upstart 2012-11-08
<SpamapS> slangasek: can't we just give people a 'forget pid' command if we can't give them the "right" solution for that bug?
<benzittlau> SpamapS: thanks, I'll give those workarounds a shot
<slangasek> SpamapS: well, in theory that bug should also be fixed when I fix bug #530779, which is inprogress-ish
<SpamapS> slangasek: thats quite encouraging to hear
 * SpamapS disappears for the day
#upstart 2012-11-09
<Aucun> Hello, after reading your getting started page, I'm totally confused.
#upstart 2012-11-11
<Jordan_U> There is a user in #ubuntu who appears to have a defunct process whose parent is init, am I correct in thinking that shouldn't be possible? Am I correct in having them submit a bug report against upstart?
<Jordan_U> Output of "ps aux" showing that the process is defunct: http://paste.ubuntu.com/1349958/ output of "pstree" showing that it's owned by init, http://paste.ubuntu.com/1349935/ .
<chris|> Jordan_U, no, it is entirely possible to have a defunct process under init
<chris|> Jordan_U, I imagine you assume that all processes under init are controlled by upstart, but that is not the case
<Jordan_U> I did assume that, apparently incorrectly :)
<Jordan_U> Is PID 1 not upstart?
<chris|> Jordan_U, imagine, for example, you run a process from the shell that daemonizes into the background, thus detaching from the shell process. Because the parent process is gone, init will then "adopt" the process.
<chris|> Jordan_U, that does not mean however that the same rules apply for those processes that would apply for processes run by upstart
<Jordan_U> chris|: Is PID 1 not upstart?
<chris|> Jordan_U, pid 1 is upstart
<Jordan_U> chris|: Is it not the responsibility of PID 1 to reap its children? Are there times when a child cannot be reaped? Am I misunderstanding something fundamental?
<SpamapS> wow
<SpamapS> I googled for 'upstart reap defunct' and your bug came up Jordan_U 
<SpamapS> "33 minutes ago"
<SpamapS> Jordan_U: its possible, perhaps even likely, that the defunct process is stuck in a syscall
<SpamapS> Jordan_U: BTW I would expect upstart to reap zombies yes
<SpamapS> Jordan_U: finding where it actually does so in the code, however, is eluding me
 * SpamapS heads to bed
<Jordan_U> SpamapS: I though that would leave it in a "D" state rather than a "Z" state (as shown in ps).
<SpamapS> Jordan_U: agreed, Z should just mean that it has exitted, and init should be calling waitpid on it to let it die
#upstart 2013-11-04
<xx4h> "emits SOMETHING" in upstart can also be used for "stop on stopping SOMETHING" afterwards?
<xx4h> meeh. where is the "umount" being handled for shutdown?
<jodh> xx4h: /etc/init.d/umount*
<xx4h> so upstart runs and there will run some init.d/* ?
<xx4h> afterwards? at which point umount is called...
<xx4h> how to trigger something to stop in upstart latest time possibe before umount is running?
<jodh> xx4h: Upstart initiates the shutdown but unmounting of disks is currently handled by the sysv scripts for compatibility. Hence, if you want to modify the shutdown, you will need to modify those scripts.
<xx4h> ok...first of all, thanks for your time-investigations...further -> what happens to upstart processes which doesn't contain a "stop on ..."-line? maybe you have a/some link(s) to a documentation on this?
<jodh> xx4h: http://upstart.ubuntu.com/cookbook/#job-with-start-on-but-no-stop-on. It is really a bug if jobs do not specify a 'stop on'. Also, sendsigs needs to be more aggressive to deal with such buggy jobs.
<xx4h> ok, thank you...in summary...it will be a big thing to stop rsyslogd just before umounts are starting...
#upstart 2013-11-05
<myndzi> i'm trying to create an upstart script that lets me gracefully exit a program
<myndzi> but in pre-stop a while loop that doesn't exit until the script is ready doesn't appear to be working
<myndzi> http://pastie.org/private/3usocsfi2u74kijm85iqoa
<myndzi> any idea what's wrong?
<myndzi> it appears to work fine if i make a bash script and run it
<xnox> myndzi: [[ is bashism. https://wiki.ubuntu.com/DashAsBinSh#A.5B.5B
<xnox> myndzi: upstart uses /bins/sh, "dash" specifically on ubuntu.
<myndzi> that explains it
<myndzi> after a lot of messing around i got something that works and is clean :)
<myndzi> thanks
<quickdry21> I've been tackling the problem of running multiple processes from the same upstart script, any thoughts on this? https://gist.github.com/quickdry21/7312841
<stgraber> quickdry21: you should look into upstart instances and use that instead of calling start-stop-daemon from a single job
<stgraber> (so split into two jobs, one doing the for loop and spawning an instance of the other for each entry)
<quickdry21> stgraber: would like to see an example of the upstart job that starts multiple single-upstart jobs... i've gotten the single-job to work but have had problems getting a loop to start other job with the script ending
<stgraber> quickdry21: http://paste.ubuntu.com/6362512/
<quickdry21> Nice - thanks, I'll be playing around with that. I knew start-stop-daemon was a bad way to to it.
<stgraber> doing it with instances also lets you use the respawn keyword and per-instance pre-start/pre-stop/post-start/post-stop scripts just like with a standard job
<Striki> I was wondering if there is a way to make sure one service does not stop until another service is stopped? As an example. We have task workers running in AWS and they are being auto scaled. So when AWS issues the shutdown command, celeryd (the task worker daemon), shuts down gracefully. I must make sure that mongos does not shut down before celeryd has been able to finish the tasks it's cleaning up.
<Striki> I've looked at stop on stopped.. start on started.. etc. - but haven't found the right way
<Striki> if I write in the task worker upstart "stop on stopping mongos" - would that ensure the task worker is stopped before mongos finishes shutting down?
<xnox> Striki: yes.
<xnox> Striki: there is a table of events & order they are emitted in.
<xnox> Striki: stopping mongos is emitted once it was decided that "mongos" should stop. At that point everything this is "on stopping mongos" should succeed, before mongos is actually stopped.
<xnox> Striki: but, i"m not sure how that will help you in the shutdown case, I thought there is a timeout after which everything gets killed, but you should have 5 seconds or so.
<xnox> not sure that one can block shutdown.
<xnox> jodh: can one block shutdown, whilst "stop on" haven't completed yet?
<jodh> xnox: not reliably since Upstart doesn't handle the final shutdown atm. - /etc/init.d/sendsigs does.
<jodh> Striki: see upstart-events(7) / http://upstart.ubuntu.com/cookbook/#ubuntu-well-known-events-ubuntu-specific for a list of events
<Striki> xnox: ok thank you a lot!
<Striki> and you as well jodh 
<rcassidy> hi all! quick q: any way to reliably log who is using initctl to start/stop an upstart job?
<rcassidy> (note: sadly, this is also a painfully old version of upstart.)
<xnox> rcassidy: not sure how would that work. But if you increase logging you will see when jobs where started/stopped.
<xnox> rcassidy: to do so, one needs to be root. So check/correlate with sudo logs.
<xnox> "to do so" to stop/start jobs.
<xnox> rcassidy: if you have custom policykit rules that you allow certain people start/stop certain jobs, check policy kit logs when those requests were granted and to who.
<rcassidy> xnox: thanks for reply!
<rcassidy> i think the best bet right now is to correlate with root logs, yes - thanks!
#upstart 2013-11-06
<jY> is there anyway to tell upstart a pid has changed?
<redondos> hello. what's the recommended way of outputting stdout and stderr of my daemon to a specific file? (not /var/log/upstart/daemon.log)
<jY> redirect ater the process to the file
<jY> after*
<jY> app 1>> stdout.log 2>> stderr.log
<redondos> jY: I'm trying that but upstart is still writing to /var/log/upstart/daemon.log
<redondos> do I need to specify any particular value for "console"?
<redondos> i know the default is "log", and I also tried "output"
<xnox> jY: change pid how? after initial started event?
<xnox> redondos: there should be an example somewhere, one sec.
<jY> xnox: haproxy on a reload changes pids
<jY> which causes upstart to freak out
<xnox> jY: that's evil. and needs investigation. you can now specify a custom reload signal, such that you could make "reload" send a harmless signal.
<xnox> jY: and have some other job to reload haproxy, or do full restarts instead.
<xnox> redondos: to redirect output you should be able to use "logger"
<jY> xnox: i take it now means it's not in the version in ubuntu 12.04?
<xnox> jY: no, not in 12.04.
<jY> ok thanks
<xnox> jY: is there a bug open against haproxy?
<jY> xnox: no but i've talked to some of the devs and they said its the way it is
<xnox> jY: haproxy package that is on launchpad?
<xnox> jY: well, ubuntu can patch haproxy and/or change configs and/or upstream patches to get it fixed.
<jY> ok
<xnox> jY: 12.04 will have 3 more years of support and 2 more point releases.....
<xnox> jY: in precise haproxy is not using upstart job, is it?
<jY> nope
<jY> we tried haproxy to make restarts quick if it dies
<jY> i mean we tried upstart
<xnox> jY: reload doesn't actually reload haproxy.
<xnox> jY: it suppose to dump every server's state, from source code.
<jY> ya
<xnox> jY: it looks like the only way to restart haproxy is to actually "stop and start" it again.
<xnox> jY: what job / conf file did you use for haproxy?
<jY> well stop will kill in flight connections
<jY> if you reload it will wait till they all finish then close the process
<jY> i think it's like how apache does it
<xnox> jY: there is "sig_soft_stop" on SIGUSR1
<jY> it's just a simple job that does like a exec haproxy -db -f conf.file
<xnox> jY:        -sf <pidlist>
<xnox>               Send  FINISH  signal  to  the pids in pidlist after startup. The
<xnox>               processes which receive this signal will wait for  all  sessions
<xnox>               to  finish  before  exiting. This option must be specified last,
<xnox>               followed by any number of PIDs.  Technically  speaking,  SIGTTOU
<xnox>               and SIGUSR1 are sent.
<jY> -sf is what we use
<jY> to reload it
<xnox> jY: so in pre-stop, you could just send those two signals.
<xnox> jY: or you can create a job to do that for you.
<jY> but with pre-stop then it won't think haproxy is up
<jY> when it is
<jY> right?
<xnox> jY: pre-stop is executed upon "restart haproxy", so you will get a graceful restart instead of tear everything down. 
<jY> ok i'll give it a try
<xnox> jY: alternative is to patch haproxy, to install / call functions which do SIGTTOU & SIGUSR1 at the moment, and make SIGHUP do that.
<xnox> jY: or you can create "haproxy-reload.conf" task, script, which does "status haproxy | grep -q start/running && then get pid and send SIGTTOU and SIGUSR1 to the main process.
<xnox> jY: i'd be happy to see that upstart job of yours included in ubuntu =)
<jY> xnox: ok let me pastebin it
<jY> http://pastebin.com/V6wy7qfQ
<xnox> jY: you write pid file to still be able to use /etc/init.d ?
<jY> for monit
#upstart 2013-11-07
<schnitzl> hi guys. i have some problems with upstart.
<schnitzl> after adding a scrit to /etc/init
<schnitzl> do i need to add it to the rc.local lile "start foo" ?
<schnitzl> or should it start automatically on every reboot when its palced in /etc/init
<jodh> schnitzl: it auto-starts: http://upstart.ubuntu.com/cookbook/#upstart-s-design-why-it-is-revolutionary
<schnitzl> i wonder what i did wrong :( i used a given script for the irc bounder znc. i just copy& pasted it. doesnt work! https://raymii.org/s/tutorials/Install_the_Lastest_ZNC_from_Source_in_Ubuntu.html
<schnitzl> its /etc/init/znc.conf
<schnitzl> when i sudo reboot it does not auto start. :(
<jodh> schnitzl: run 'init-checkconf /etc/init/yourjob.conf' to check if the syntax is valid.
<schnitzl> k sec.
<schnitzl> ERROR: failed to ask Upstart to check conf file
<schnitzl> jodh: this means the syntax is broken ?
<jY> schnitzl: pastebin your conf
<schnitzl> http://pastebin.com/xSyatNqW
<jY> as root can you su - znc
<jY> then as znc run /usr/local/bin/znc --datadir=/var/lib/znc -f
<schnitzl> so i need a user called znc ?
<jY> yes
<jY> that is what setuid means
<schnitzl> and if i reboot, will it auto start znc ?
<jY> its runnung that command as that user
<jY> yes
<schnitzl> yayyy! :D so znc user is missing. this iwll fix it. 
<schnitzl> which line in the script tells it to run it as user znc ?
<jY> setuid
<schnitzl> bamm finally. thank you! 
<schnitzl> guess ima kill my bnc now. thanks again :)
 * xnox also uses znc =)
<rewritten> hello
<rewritten> can anyone help me?
<rewritten> I'd like to configure a number of similar services (similarly to the typical mongrel cluster)
<rewritten> all the services have the same exec, except for the STOUD redirection. But it may perfectly be related to the name of the script file.
<rewritten> so the question is: can I just symlink the conf file to many others, and have each one detect its own name and use it?
<benlangfeld> Good afternoon guys. I'm having some trouble with Upstart and setting PATH. I'm trying to do this: export PATH=~/.rbenv/shims:~/.rbenv/bin:$PATH, but it looks like maybe $PATH is not being interpolated correctly. What am I doing wrong?
<xnox> benlangfeld: can you post your full job?
<xnox> benlangfeld: is that for saucy session init?
<benlangfeld> xnox: https://gist.github.com/benlangfeld/a5bde3e2ba7991a4939d
<benlangfeld> I have no idea what you mean :)
<xnox> benlangfeld: $HOME is not set, so "~" doesn't epand to anything.
<xnox> benlangfeld: upstart jobs are executed as root user without $HOME set. without your user-account environment.
<benlangfeld> xnox: Doesn't make any difference, it's not ending up in PATH in the bin/brain script.
<benlangfeld> xnox: Expanded or not, it doesn't really matter :)
<xnox> benlangfeld: it does matter. since your PATH is invalid and doesn't even have "start-stop-daemon" on it.
<xnox> =)
<xnox> hence exec not able to find "start-stop-daemon"
<benlangfeld> xnox: Ok, I'll clear that up and see what happens.
<xnox> benlangfeld: remove env PATH= line, remove export PATH, remove #source line
<xnox> benlangfeld: and instead use
<xnox> benlangfeld: exec PATH=/full/path/to/home/user/.rbenv/shims:$PATH start-stop-daemon .... 
<xnox> benlangfeld: not sure why you make your script so  complicated thought.
<benlangfeld> What's complicated about it?
<xnox> benlangfeld: i left a comment on the gist.
<benlangfeld> xnox: I thought use of start-stop-daemon was recommended since upstart won't manage PIDs?
<xnox> benlangfeld: it doesn't need PIDs
<benlangfeld> hmm, ok
<xnox> benlangfeld: start-stop-daemon is discouraged, but so many people cargo cult that from somewhere I really want to know where you find that =)
<xnox> benlangfeld: i don't know what bin/brain is.
<xnox> benlangfeld: if it forks, add "expect fork". If it daemonises add "expect daemon"
<xnox> benlangfeld: logs are storred in /var/log/upstart/adam-brain.log
<xnox> (both stdout and stderr)
<benlangfeld> xnox: Can I configure the log path?
<benlangfeld> As for start-stop-daemon, it's pretty much everywhere you google about upstart config :)
<benlangfeld> For example here: http://stackoverflow.com/questions/9972023/ubuntu-upstart-and-creating-a-pid-for-monitoring
<benlangfeld> I updated the gist. The job no longer validates (upstart's error in that case is awful btw)
<xnox> benlangfeld: no, log path is not configurable. you can configger one with e.g. logger
<benlangfeld> aha, it's setuid
<xnox> yeah, sorry.
<xnox> $ init-checkconf adam-brain.conf
<xnox> ERROR: File adam-brain.conf: syntax invalid:
<xnox> init:adam-brain.conf:9: Unknown stanza
<xnox> $ init-checkconf adam-brain.conf
<xnox> File adam-brain.conf: syntax ok
<xnox> with setuid.
<benlangfeld> It still doesn't like having PATH after the exec
<benlangfeld> I think I need to export it
<benlangfeld> gist updated again, I'm not sure what's going on here
<benlangfeld> Using env and specifying the full path works, it's just the interpolation that doesn't. That'll do for me for now. Thanks for your help xox.
<xnox> benlangfeld: i thought it would work. Seems to work here if I replace "exec" with "script .. end script"
<xnox> benlangfeld: see new commend
<jY> http://www.buttpaste.com/products/original-butt-paste
#upstart 2013-11-08
<xnox> jodh: upstart testsuite failed on the distro builders. And i'm not sure how to fix it.
<xnox> at or about:
<xnox> ok 136 - re-exec support single job producing output across a re-exec
<xnox> Bail out! wrong value for set_upstart_session (session_init_pid), expected TRUE got FALSE	at test_util_common.c:87 (wait_for_upstart).
<jodh> xnox: looks xdg_runtime_dir-related.
<xnox> jodh: as in, it's set or not set =) and if that's good or bad. Let me try this locally.
#upstart 2013-11-09
<SDr> hi upstart, this was intended to automagically bring nginx up on boot: http://pastebin.com/xrihJsZv
<SDr> however, upon reboot, nginx fails to start; no errors on boot screen
<SDr> using ubuntu 10.04 LTS
#upstart 2014-11-03
<crystal77> How does the OS know to use an upstart script? isn't it true that calling service apparmor ____ is the same as calling /etc/init.d/apparmor ____? That's where the script lives, so it's the same thing...
<jodh_> crystal77: service(8) is a sysv facility - upstart uses start/stop/restart (see initctl(8)), but on upstart systems, service(8) is "upstart-aware" and will dtrt if you try to use it to control an upstart job.
<crystal77> Lot of acronyms there, haha
<jodh_> crystal77: your question is basically about how sysv services are handled and yes you can use either the /etc/init.d/$service script or the service(8) command. Upstart jobs live in /etc/init/, not /etc/init.d/.
<crystal77> right, but what if you have both? which will it use?
<crystal77> that's where the confusion comes from.
<jodh_> crystal77: upstart jobs take priority.
<jodh_> crystal77: note that this behaviour is documented in service(8).
<crystal77> What does "dtrt" mean?
<crystal77> and sysv = system 5?
<jodh_> crystal77: do the right thing.
<jodh_> crystal77: yes
<crystal77> OH
<crystal77> now it makes more sense...
#upstart 2014-11-04
<switchflip> Hello... is anyone on here willing to try and help with a upstart issue I'm having
<mustmodify> Upstart knows how to start a process, with status message "project-dev start/running, process 24020 ", but doesn't know how to stop it. Can someone give me a push in terms of how to think about solving this problem?
<switchflip> I am having a similar problem with upstart.
<switchflip> I start a process, it forks but upstart loses track of the PID and then it is unable to stop the process or restart it.
<switchflip> Apparently it is a known bug (https://bugs.launchpad.net/upstart/+bug/406397)
#upstart 2014-11-05
<carbn> hi. what would be the correct way of setting the default permissions for a log file? looks like they default to 640 root:root but i'd like to have 644
<lkthomas_> hey guys
<lkthomas_> does upstart on ubuntu 14 contain time based event ?
#upstart 2014-11-06
<jmacdonald> hi. i guess no variables allowed in things like chdir ?
<dibic> hi, im using upstart to start/stop gunicorn. service gunicorn start works, but when i try to stop i get an unknown instance error. i don't have an expect stanza; when i tried i ended up in a start/killed state and had to use a workaround. any suggestions?
#upstart 2014-11-07
<sirkha1> okay, maybe my search-foo is weak today, but I cannot find anything on the web explaining if upstart development will continue, and for how long now that debian and ubuntu have made the decision to switch to systemd
#upstart 2014-11-08
<merpnderp> I've got a job that isn't started on init 6. It works with start myapp; stop myapp; but I get nothing on a reboot.
<merpnderp> Any ideas on how to troubleshoot?
<merpnderp> start on startup is how I have it set to start
<merpnderp> was starting my app before networking was up....fixed. :)
<JanC> "startup" is very early  :)
#upstart 2014-11-09
<merpnderp> JanC: hah, apparently so :P
#upstart 2016-11-08
<timvisher> in an upstart job, if i use `respawn \n respawn limit 10 5 \n post-stop exec sleep 60`, does that mean that my respawn limit will never be reached because it should never respawn more than once every 60 seconds?
<timvisher> it looks like it's true that if you sleep between respawns you have to also increase the interval to encompass the sleep duration
<timvisher>  
<supergonkas> timvisher: the respawn limit tells the max times it can restart for a X time
<supergonkas> So if it's broken or something and keeps restarting, it won't do it for ever 
<supergonkas> If I understood your question 
<timvisher> supergonkas: right. so if you're sleeping between each invocation (say for 1 second) and your respawn limit is 10 5, then you'll by definition never hit that limit
<timvisher> because you can't respawn 10 times in 5 seconds if you're sleeping for a second every time you respawn
<supergonkas> Yes
<supergonkas> Mm well depends if the service crashes before the sleep is executed, I think 
<timvisher> so you basically need to incorporate the sleep time and assume that you're failing immediately or some how otherwise determine the acceptable failure overhead
<timvisher> eh? sleep is being executed in post-stop
<timvisher> so no matter how the process dies it'll sleep, unless you're using `stop` explicitly iiuc
<timvisher> is that accurate?
<supergonkas> Ignore me, just re-read your original message 
<timvisher> lol. no problem :)
<timvisher> thanks for the help
<supergonkas> Yes I would say the sleep is always executed 
<supergonkas> Your best bet is just increase the interval of the respawn limit, that is within the same frequency as the original 
<supergonkas> Or move the sleep 
<supergonkas> *I think your best bet.. 
<timvisher> supergonkas: yep. that's what i did. i have a sleep of 60 seconds and a respawn limit of 30 ~1800
<AnrDaemon> timvisher: Check the cookbook. It has the flow diagram.
<timvisher> AnrDaemon: where?
<timvisher> oh nevermind i found it
<AnrDaemon> google "upstart cookbook", first result ;)
<timvisher> not the cookbook itself, the flow diagram :)
<AnrDaemon> The two biggest pics in there.
