#upstart 2006-11-13
<mbiebl> Keybuk: do you know,  in what version of glibc, the WEXITED flag for waitid was introduced?
<mbiebl> Tried to build upstart on sarge, and it failed miserably, because of that ;-)
<Keybuk> mbiebl: oh, almost certainly very recently
<Keybuk> waitid itself was only introduced in 2.6.9
<Keybuk> (and is broken on compat arches in all kernel releases until the next one <g>)
<mbiebl> until next one means 2.6.19?
<Keybuk> 2.6.20 maybe
<mbiebl> oh
<Keybuk> (upstart works around it though
<yankees26> how?
<Keybuk> how works around, or how broken?
<yankees26> how it works around it?
<Keybuk> it clears the siginfo_t structure before passing it to waitid
<Keybuk> the bug is that compat_sys_waitid() in the kernel doesn't copy zero values
<yankees26> ah, so shouldn't it build for mbiebl in that case?
<Keybuk> yes
<Keybuk> dunno what the WEXITED thing might be, just looking that up atm
<yankees26> ah
<Keybuk> it's entirely possible that it's simply missing on really old libc
<Keybuk> seeing as the syscall itself is recent
<yankees26> mbiebl: what version of glibc do you have?
<Keybuk> sarge doesn't have 2.6 as default, no?
<Keybuk> and only has 2.6.8 as an option
<Keybuk> so upstart won't work with that
<yankees26> ah well im in luck 'cause i dont use debian
<yankees26> of course i first have to get through the majority of LFS :P
<mbiebl> yankees26: sarge has 2.3.2, current unstable (which I run) 2.3.6
<yankees26> ah
<yankees26> well by the time i get to LFS glibc 2.5 will probably be out of testing in arch (currently on 2.4) so
<yankees26> hopefully i wont run into your problem
<Keybuk> upstart fully supports glibc 2.4
<Keybuk> glibc2.4 and kernel 2.6.17 were the recommended targets
<yankees26> i run both of those :D
<mbiebl> Well, it never hurts to support a broader audience
<Keybuk> mbiebl: actually, it hurts a little bit
<mbiebl> Sure, for developing.
<mbiebl> But I rather meant acceptance.
<mbiebl> Keybuk: you said you work around the waitid issue, does that mean upstart works on a 2.4 kernel?
<Keybuk> no
<Keybuk> upstart only works around the mis-behaviour of compat_sys_waitid
<Keybuk> while I sit on Kyle's lap until he fixes it
<Keybuk> it doesn't have any alternative for waitid if that syscall doesn't exist
<yankees26> Kyle is?
<_ion> keybuk: Are new conclusions related to upstart that were reached at uds-mtv documented somewhere?
<mbiebl> Keybuk: what exact feature of waitid do you need, which couldn't be implemented otherwise?
<Keybuk> mbiebl: the fact it can obtain information about a dead process without actually reaping it
<Keybuk> so we can find out things like it's binary name, cpu time, etc.
<mbiebl> ah, ok
<Keybuk> _ion: not yet, got to finish writing them up
<Keybuk> mbiebl: that will be necessary for supporting supervision of processes that fork
<yankees26> does uds-mtv stand for ubuntu developer summit mountain view?
<Keybuk> yankees26: yes
<yankees26> ok, just making sure (im not intune with ubuntu development stuff)
<mbiebl> Keybuk: maybe these requirements should be documented somewhere.
<Keybuk> mbiebl: they'll be in the README
<mbiebl> good
<yankees26> hey guys (slightly off-topic): to have a project and bazaar in launchpad, does the project need to be affiliated with Ubuntu?
<Keybuk> yankees26: nope
<Keybuk> free hosting for all
<yankees26> ok
<yankees26> crimsun on #launchpad beat you to it ;) (thought you all had died here so asked there :P)
<yankees26> thanks though
<yankees26> i have added my project :D
<yankees26> (now to setup bazaar)
<Keybuk> I did die
<Keybuk> updated to latest feisty
<Keybuk> and rebooted
<yankees26> hehe
<yankees26> how is it?
<Keybuk> unstable and buggy :p
<yankees26> sounds like fun :D
<yankees26> ugh, ~/.ssh/ has no id_dsa.pub or id_rsa.pub!?!?!
<yankees26> ah, had to create one
<yankees26> could someone with gpg experience help me?
<_ion> PGP and SSH keys are a different thing. See ssh-keygen(1), ssh-add(1) and apt-cache show keychain
<yankees26> i figured out the ssh key
<yankees26> for gpg i did gpg --gen-key and that finished
<yankees26> but im not sure what "number" is the actual key for gpg --send-key
<_ion> There are quite good GnuPG tutorials in the web.
<yankees26> ok
<yankees26> TO THE INTERNET!
<_ion> To the tubes
<yankees26> that too P
<yankees26> is it the thing after pub from gpg --list-keys?
<_ion> It's the 2EE24E0B in 'pub   1024D/2EE24E0B 2005-07-03'
<yankees26> ah
<yankees26> thanks _ion
<myren> is there a runtime daemon?
<myren> what is it coded in?
<myren> how portable is it?
<myren> it uses dbus, right?  what dbus api does it make use of (low level or glibc)
<Keybuk> runtime daemon?
<Keybuk> upstart is an init replacement, so it does have a /sbin/init, yes
<Keybuk> it's written in C
<Keybuk> not portable at all; aimed squarely at current Linux and glibc
<Keybuk> the currently released version does not use dbus, there's a branch which uses low level api
<myren> i meant portable between architectures
<myren> there's a lot more variants of linux than ubuntu alone supports
<myren> ooh, glad there is dbus integration, thats swell.
<Keybuk> it compiles on most, yeah
<Keybuk> there's an open bug about hppa which is committed in the bzr tree
<myren> the daemon keeps running right?
<myren> beyond just startup
<Keybuk> yes
<Keybuk> it's pid 1
<myren> hppa?  hp power risc?
<myren> just a guess
<Keybuk> yeah
<myren> i know he's gone, but, thanks mate
<Amaranth> if the daemon stopped running your computer would break :P
<myren> duly noted Amon
<myren> err, Amaranth
<myren> as in, Seveasoft?
<myren> is there any info on dbus integration besides the source?
#upstart 2006-11-14
!alindeman:*! Regional server split, looking into it
<fx|RabBit> hmm.. hi
<wasabi> Random knowledge from Windows: Windows Services are .exe files which use a messaging API to the service host. The service host does the normal respawn stuff, but it can also detect when the service "fails to start". It does so because when the service is successfully started, it should send a message.
<wasabi> And after a timeout, it hasn't yet happened. The API lets the service "request more time".
<wasabi> Interesting concept.
<wasabi> This allows the GUI to act a bit more reasonably... it can basically say "Starting...", and only remove the box when everything is in fact properlly started.
<wasabi> We can do the same with creative uses of post-start though.
<myren> its a watchdog timer
<myren> ping the system to make sure its responsive
<myren> if you dont get a ping back, assume the worst
<myren> how would you do that with post-start?
<myren> you'd need to ddo a dbus ping or something
<myren> i cant think of how else you'd query/ping
<Keybuk> wasabi: launchd uses a similar system
<Keybuk> I was talking to the Nokia guys about having some kind of upstart/service communication as well
<wasabi> myren: Well, post-start is up to the service to implement however it feels like it. For apache, it could actually issue a GET.
<myren> right
<myren> i was thinking about just portscanning
<myren> lookup the pid in netstat and see if its listening
<wasabi> Sure, it just connect to it to see if it answers.
<wasabi> Anything.
<myren> launchd is osx right?
* myren nods
<myren> yup
<wasabi> My dislike with having the service talk to upstart itself is one of politics.
<wasabi> You'd have to introduce basically a binary dependency to upstart from Apache.
<wasabi> Which wouldn't go over so well.
<Keybuk> right
<Keybuk> it's useful in things like the 770 though
<wasabi> Yeah.
<wasabi> You also could accomplish the same thing with post-start itself pretty easily.
<wasabi> post-start would start "apache-watcher" or something, a binary, which could talk to apache however it wanted to.
<Keybuk> right
<myren> it makes sense with dbus
<myren> check to see if it has a com.ubuntu.upstart.ping or something
<myren> and if it has the service, hit it
<myren> no dependencies
<wasabi> Sure, but dbus is itself a dependency most don't want in that place.
<Keybuk> right
<myren> what, upstart or the app?
<wasabi> both.
<myren> oh, well then you got nothing
<myren> if you dont want to add functionality you wont get functionality
<myren> which is fine
<wasabi> I doubt the apache guys want to build in dbus to apache. :0
<wasabi> A helper? Sure.
<Keybuk> I like the optional functionality idea
<wasabi> But apache runs on windows too.
<myren> build yourself a 3 line dbus script
<myren> that it can optionally use
<myren> the real issue is with dbus, there's not a particularly good way to dbus a process by its process id
<myren> i really think dbus is the way to go here
<myren> its the only quasi standard communication system you've got
<wasabi> You mean other than unix sockets.
<myren> a wget ping will help apache and no one else
<wasabi> Heh.
<myren> but you'd need a ping protocol for unix sockets
<wasabi> You'd need the same for dbus.
<wasabi> And a ping protocol is nothing more than a if (!connect())
<myren> uh, is that applicable for unix sockets
<wasabi> Either way, I don't think it needs to be part of upstart prime. Simply dispatching to an external helper imo is hte best.
<myren> its definately a great idea
<myren> i like dbus because its functional
<myren> if you ping something
<myren> and you get a reply, you can be just about certain its not totally hung
<myren> it negotiated itself basically beyond reproach
<myren> no ones going to just happen to answer it
<myren> unless they mean to
<wasabi> Sillyness
<myren> i dunno, it seems like a much more contractual garuntee than seeing if a socket is open
<myren> that seems, i dunno, antiquated
<wasabi> "Seems antiquated" isn't a very compelling argument.
<wasabi> dbus is massively complicated for something in PID1.
<myren> as a system wide eventing daemon
<myren> it better fucking support dbus
<myren> um
<myren> i'm no one, ps
<wasabi> It will, with a proxy.
<wasabi> Upstart itself uses a plain unix socket.
<myren> i have absolutely zero say in this project
<myren> but personally i think dbus is the only acceptable IPC
<wasabi> On what grounds?
<myren> its a protocol
<myren> thats it
<wasabi> Huh?
<myren> its not a socket
<wasabi> Yes it is. ;)
<myren> a protocol defines ways of talking with each other
<myren> you can scream anything and everything into a socket
<wasabi> DBUS is a very large complicated messaging API, implemented on top of a socket.
<myren> which is why its useful
<myren> its an API for IPC
<myren> anyone can open up dbus
<wasabi> I suspect you have conflicting goals.
<myren> and start communicating
<myren> discovering
<myren> eventing
<myren> knowing nothing about hte system
<wasabi> 1: A user space friendly GUI application managing services. DBUS is nice for that.
<myren> its a machine to machine communication language
<wasabi> 2: PID 1
<_ion> We should use XML for IPC! Upstart doesn't have a sufficient amount of enterprise yet.
<myren> upstart is not just another pid 1 replacement
<wasabi> Hmm. Yes it is. ;)
<myren> it seems to me like the goal is much larger than simply initializing programs
<wasabi> jhaltom@station-1:~$ ls -al /sbin/init
<wasabi> -rwxr-xr-x 1 root root 57696 2006-10-10 05:42 /sbin/init
<myren> that there's a strong eventing componenet too
<wasabi> jhaltom@station-1:~$ ls -al /usr/lib/libdbus-1.so.3.0.0
<wasabi> -rw-r--r-- 1 root root 195484 2006-10-20 06:46 /usr/lib/libdbus-1.so.3.0.0
<wasabi> dbus is almost *4* times larger than upstart.
<myren> whats an order of magnitude or two between friends
<wasabi> Excluding dependencies of dbus.
<myren> ok, size asize
<myren> aside
<myren> practicality aside
<myren> just for a second
<wasabi> Why put it aside? It's are core argument.
<wasabi> It's PID1.
<myren> because its your only reply to everything i say
<wasabi> If it crashes, your system turns off.
<myren> and you ignore every point i make simply on that ground
<myren> just bear with me for a second
<_ion> I don't really see moving from 60k to 200k as a problem with any hardware upstart is running on. Oh, and:
<_ion> -rwxr-xr-x 1 root root 1166796 2006-10-10 17:46 /lib/libc.so.6
<wasabi> Sure.
<myren> sorry work for a second
<_ion> I don't have a strong opinion either way. I guess dbus is as good protocol for IPC as any.
<myren> v. sorry
<myren> ok back
<myren> the thing is, most pid1's play a passive role in the system
<myren> they launch a bunch of shit and then go to sleep and become obsolete
<myren> upstart, to me, signifies very much more of an event based process management system
<myren> rather than simply an init script
<myren> i could be misconstruing the goals, but it seems to be something that continues doing useful work as the system stays up
<myren> to really effectively do that, it needs to be capable of eventing with other subsystems
<myren> it needs IPC
<myren> i could be totally misconstruing the goals purpose & design here
<myren> but i thought the idea was to make it functionally more complex
<myren> thats it
<wasabi> 1) Most inits continue doing useful work, such as switching runlevels, which can be considered "acting on events".
<wasabi> 2) It is currently capable of IPC. It alrady has it.
<myren> thats the main stimuli-response i see
<wasabi> 3) The goal of software is never to make it more complex.
<myren> no thats your goal
<myren> The current version of Ubuntu, for example, includes sysvinit, atd, crond,
<myren> anacron and netkit-inetd; all of which are congured dierently, yet are
<myren> arguably performing the same kind of job.
<myren>                           jobs such as starting and stopping services and run-
<myren> ning user scripts are also performed by packages such as udev, acpid, apmd,
<myren> ifupdown and even module-init-tools
<myren> your goal is to replace that with something complex & functional enough to serve as a replacement
<myren> upstart is a single replacement for the standard UNIX services, combining their
<myren> functionality into a single daemon which can be easily congu
<myren> me: your goal is to replace that with something complex & functional enough to serve as a replacement
<wasabi> No, my goal is to replace it with something functional enough to serve as a replacement, not neccassarily complex.
<myren> i'll do more real digging into upstart & get back to you
<myren> i dont really know your functional capabilities yet
<myren> just scares me when codesize is the big bad voodoo monster threat
<wasabi> I used codesize as a poor example.
<wasabi> Should have picked a figure to more accurately represent complexity.
<myren> and i just hyperbolized rather injurously
<wasabi> DBUS is complicated. It has all sorts of cool things which are very useful, but few of which are neccassary for a system seemingly requriing only the sending of events and starting of named jobs.
<wasabi> Not to say we don't want a DBUS API to those, we do.
<wasabi> Just that it's not likely to be implemented in PID1, but likely as an out of process proxy.
<wasabi> Personally I think simply invoking an executable and waiting for a return value ==0 is simplier than introducing DBUS in both init and apache.
<wasabi> Which is where all this started.
<myren> no i agree with you a lot more now, dbus in upstart proper is a bad idea
<myren> i need to see how hard it'll be to make a proxy
<myren> aka try and make one
#upstart 2006-11-15
<myren> is there any dbus work / proxy started?
<myren> i'm gonna do some code slinging tonight
<myren> curious if there's any place to start from
<Keybuk> not yet
<yankees26> in other words... sling away ;P
<myren> kk
<Keybuk> myren: it can use libupstart to receive event and job notifications from upstart
<Keybuk> and send commands/events back
<Keybuk> the general thought was that it should have an easy method of mapping dbus messages to upstart events, and vice-versa
<myren> i might end up bit banging the protocol
<myren> i'm still not too good at consuming C/C++ libs
<Keybuk> "bit banging"?
<myren> talking to the socket directly
<Keybuk> oh, don't do that
<_ion> So when upstart's protocol is modified, both libupstart and your program will have to be modified instead of just libupstart?
<Keybuk> I reserve the right to change the protocol
<Keybuk> like in the code on my laptop at the moment <g>
<Keybuk> _ion: libupstart implements the protocol /sbin/init uses too
<myren> blarg ok
<_ion> That's what i meant, although i could have articulated it better.
<Keybuk> and the protocol is evil to implement by hand anyway
<_ion> Indeed.
<_ion> Different implementations of the same version of a single protocol may be bug-incompatible, too. Better to have the same bugs between both ends of a connection. :-)
<myren> i take it libupstart has very little dependencies
<Keybuk> just libnih
<Keybuk> and I don't think it exposes that
<_ion> If you have a program that communicates with upstart on the same host, you're going to have libupstart installed anyway.
<myren> i'm just more worried about langauge bindings
<Keybuk> language bindings/
<myren> consuming the libupstart
<Keybuk> it's pretty easy
<Keybuk> #include <upstart/control.h>
<Keybuk> int sock = upstart_open ();
<Keybuk> upstart_send_msg (sock, send_msg);
<Keybuk> recv_msg = upstart_recv_msg (NULL, sock, NULL);
<Keybuk> upstart_free (recv_msg);
<Keybuk> where send_msg/recv_msg are an UpstartMsg struct, see the header for the docs for each possible one
<Keybuk> you'd probably send UPSTART_WATCH_JOBS and then call recv_msg a lot
<myren> i just have to worry about pinning any data strutures used
<Keybuk> pinning?
<myren> making sure my garbage collector doesnt move them around
<yankees26> night
-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)
-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)
-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 main rotation server disconnected for a few seconds.  It's back now and has been removed from rotation.
<myren> exploit enabled
<myren>    ---^
<Keybuk> ?
<tonfa> utf-8 screen exploit ?
<Keybuk> just looks like arabic to me
<Keybuk> specifically arabic for "My hovercraft is full of eels"
<tonfa> google says the same :)
<_ion> It's Arabic, therefore they si teh TERRORIST
<myren> awsome
<myren> terrorists with hovercrafts full of potentially electric eels
<myren> we are surely doomed
<_ion> With freaking lasers on their foreheads
<cortana> what the whatty what what
#upstart 2006-11-16
!christel:*! Hi all! One of our sponsors just experienced somewhat of a network burp affecting our US hub. They've coined the phrase 'Network outages bringing people together', and are looking into the slight hiccup as we speak. I apologise for the inconvenience. Thank you for using freenode, and wish you a pleasant night.
<psibox> hi
<psibox> can i active some sort of logging for upstart in edgy, that tell's me the order in which all scripts where actually called ?
<psibox> same for network/interfaces/if-up.d and friends...
#upstart 2006-11-17
<sadleder> hi all, maybe not especially related to upstart, but does anyone know a preferred way to temporarily disable shutdown of a system
<sadleder> i mean a scenario in which a system is administered remotely, but has local users
<root____> Hello all, I searched all over and im probably just plain stupid. I dont have an implentetion in fron of me but trying to figure out how upstart gets the default run level.. should i still use inittab?
<root____> nm i figured it out ithink.. just have to get used to events.. if i still want runleves ill do a event on startup and define runlevels in that and other events based on that.. take care and an ty
<cryptom> hi all, is there an "automated way" to improve startup time with upstart? I've upgraded from dapper to edgy and seem to have much longer boot times.
<Seveas> cryptom, improving startup time isn't a goal of upstart
<psibox> do you know how i can find out the order in which the startups have been called ?
<psibox> i have a problem that an nfs-mounted fs does not appear in /etc/mtab
<psibox> then updatedb does not detect that it's NFS and indexes 2TB. from all clients.
<cryptom> Seveas, oh, really, then I must have misunderstood something I read on the net (or mixed it up with something else). I just thought that a new startup system could only be faster (starting services in parallel, not serial)
<cryptom> than the old-fashioned sysvinit
<Seveas> cryptom, a side effect of a fully upstart-ized init system willprobably a significant improvement in startup time
<Seveas> however, it is not a goal
<Seveas> and in ubuntu edgy, upstart is not used to its full potential, the only startup time improvements come from the dash-as-/bin/sh change
<cryptom> Seveas, I understand that, I think the goal is to still have control once the services are started
<cryptom> and not just "fire and forget"
<cryptom> Seveas, dash-as-/bin/sh ?
<maro> cryptom: /bin/sh -> /bin/dash
<Seveas> cryptom, the primary goal was to get rid of all horrible race conditions in init
<maro> (instead of bash)
<Seveas> the goal now seems to be "to take over the world"
<maro> Seveas: no scm action in the past 2 weeks though, seems to have stalled :)
<cryptom> ;-)
<Seveas> maro, LOL
<Seveas> they've been very busy designing th beast
<Seveas> lots of goodness is coming up
<cryptom> Seveas, ok, thanks for the clarification
<psibox> how can i turn on some kind of debug info for upstart ?
<psibox> is there anything in place ?
<Keybuk> psibox: boot with --debug as a kernel option
<psibox> thanks, will try that.
<psibox> after boot i'm missing NFS filesystems in /etc/mtab. /proc/mounts is ok, fs is mounted, but /etc/mtab ist wrong.
<Keybuk> oh, that's just a usual ubuntu bug
<psibox> well, that's pretty bad.
<psibox> is there a fix ?
<psibox> what's causing this ?
<maro> Keybuk: busybox claims /etc/mtab is obsolete and should be a symlink to /proc/mounts on "modern distros" - do you know why that isn't the case on ubuntu?
<psibox> maro: interesting. i read somewhere (can't find it right now) that linking /etc/mtab to /proc/mounts was a bad idea. unfortunately the poster didn't explain why
<Seveas> that would make /etc/mtab unusable before /proc is mounted. Not sure if that matters though
<Keybuk> there are mount options in /etc/mtab that do not appear in /proc/mounts
<psibox> like 'noquota'. this breaks (kind of) quota.
<obenbohne> hi Seveas!
<obenbohne> hi Seveas
<Keybuk> wasabi: around?
* ..[topic/#upstart:Keybuk] : Upstart 0.3.0 | http://upstart.ubuntu.com/ | http://upstart.ubuntu.com/doc/getting-started.html | http://upstart.ubuntu.com/wiki/ | irc logs: http://people.ubuntu.com/~fabbione/irclogs
#upstart 2006-11-18
-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)
-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)
<PingunZ> Is there any way to *speed up* upstart by selecting the startup processes ?
<AlexExtreme> PingunZ: you can use the service gui in System -> Administration -> Services i think
<PingunZ> cool, thanks
#upstart 2006-11-19
<root___> hello? anyone feel like aswer a question?
<root___> im trying to install upstart and have it going.. but i dont have edgy eft.. is it only the example jobs that have been converted in that realese or does it have more scripts? I wanna remove my sysv complete would like to look at some more examples.. udev etc
<root___> more specific ... teh event chain used in efty edge.. like mount kernel filessystems first etc.. what order u do it in..
<wasabi_> We don't.
<wasabi_> edgy includes no upstart events other than sysv emulation.
<root___> ok thanks... then ill fix my own chain
<root___> am i right if i think that if i make a job start on anotherjob/stopped it will start when that job is finished running?
#upstart 2007-11-14
<ion_> asdaf: IIRC logd was disabled temporarily.
<asdaf> ion_, so to use I need to make a job to start it and manually send SIGCONT after start, is it correct?
<ion_> I donât remember.
<Keybuk> asdaf: you'll hit a race condition where it won't be started before the first jobs
#upstart 2007-11-15
<mojo__> Keybuk: thanks for ur advice yesterday, i finally got my script ported to access directly the keyboard
<mojo__> Keybuk: and it works
<mojo__> Keybuk: :)
<mojo__> Keybuk: i just have 1 question, I created my weird daemon file in /etc/event.d/
<mojo__> Keybuk: in which I make it start on level 2,3,4,5
<mojo__> Keybuk: when I reboot, the daemon is not started
<Keybuk> how did you write it?
<mojo__> Keybuk: u still there?
<mojo__> plese excuse me, i will flood the irc a bit
<mojo__> description	"weird service daemon"
<mojo__> author		"Trung Le<joneslee85@gmail.com>"
<mojo__> start on runlevel 2
<mojo__> start on runlevel 3
<mojo__> start on runlevel 4
<mojo__> start on runlevel 5
<mojo__> stop on runlevel 0
<mojo__> stop on runlevel 1
<mojo__> stop on runlevel 3
<mojo__> stop on runlevel 6
<mojo__> console output
<mojo__> exec /var/www/perlscript/control.pl
<mojo__> respawn
<mojo__> Keybuk: this is the code
<Keybuk> should work
<mojo__> i know
<mojo__> but when I restart
<mojo__> the script doesn't executed
<mojo__> ....
<mojo__> or should i add in
<mojo__> start on startup?
<Keybuk> assuming you're using Ubuntu?
<mojo__> yes
<mojo__> Keybuk: Ubuntu Gutsy
<Keybuk> how do you know it's not running?
<mojo__> well
<mojo__> initctl list
<mojo__> i know immediately
<Keybuk> right
<Keybuk> but it may have run, and then failed and restarted enough times to be stopped
<mojo__> hmm
<mojo__> but it works
<mojo__> if i run start weird
<mojo__> or stop weird
<Keybuk> that's why I suspect it is failing for some reason when run at startup
<mojo__> hmm
<mojo__> Keybuk: hint on debug?
<Keybuk> replace exec with
<Keybuk> script
<Keybuk>    touch /tmp/foo
<Keybuk>    exec ...
<Keybuk> end script
<Keybuk> and see whether /tmp/foo apperas
<mojo__> okay
<mojo__> i do it now
<mojo__> Keybuk: rebooting
<mojo__> Keybuk: the bug might be with the order services starts
<Keybuk> exactly
<Keybuk> you'll be starting before anything in /etc/rc2.d
<mojo__> Keybuk: b/c my script need mpdd and lcdd
<mojo__> Keybuk: those 2 are SysVinit services
<Keybuk> oh
<Keybuk> that's why it doesn't work then :)
<mojo__> Keybuk: if those services are not started, then my script won't work
<mojo__> Keybuk: can u show me how to make sure it loads after those 2
<Keybuk> so yeah, your service is being started and then fails
<Keybuk> start on stopped rc2
<Keybuk> start on stopped rc3
<Keybuk> etc.
<Keybuk> instead of on runlevel 2
<mojo__> okay
<mojo__> perfecto!!!
<mojo__> it works!!
<mojo__> i am so happy!
<mojo__> thank you so much u know
 * Keybuk hmms
<Keybuk> I almost forgot to not "bzr push" there
<Keybuk> \o/
<Arafangion> Keybuk: Hey.
<Keybuk> heyhey
<Arafangion> I took another shot at troubleshooting upstart yesterday, with your quick bash script.
<Arafangion> exec strace /sbin/init "$@"
<Arafangion> Unfortunately, that means that /sbin/init is no-longer associated with process id 0, which it explicitly checks before dying.
<Arafangion> Which makes sense, I remember seeing that before.
<Keybuk> oh, right
<Keybuk> damn
<Keybuk> I'd forotten that
<Arafangion> Next time I feel like it, I _could_ remove that check from the source code myself, and recompile init...
<Arafangion> I'm thinking I might as well just revert to bsd-style init, though - unless you have some good ideas?
<Keybuk> the way I'd debug it would be to break in the initramfs before exec'ing init
<Keybuk> and then open up a new vt with bash running
<Keybuk> so I could run initctl events and initctl jobs from it
<Arafangion> What initramfs? ;)
<Keybuk> make one :p
<Keybuk> init is hard to debug
<Keybuk> you have a strange unexpected behaviour
<Keybuk> you may be able to get away with something like:
<Keybuk>   start on startup
<Keybuk>   script
<Keybuk>     initctl jobs > /tmp/jobs.txt
<Keybuk>     initctl events > /tmp/events.txt
<Keybuk>     wait
<Keybuk>   end script
<Keybuk> but you'd need a writeable filesystem for that
<Keybuk> oh and "&" on the ends of those lines :p
<Arafangion> It's writable very early on.
<Keybuk> earlier than the mount_stage1 you're trying to debug? :p
<Keybuk> actually
<Arafangion> It's the _end_ of mount_stage1 that's the problem. :)
<Keybuk> your mount_stage1 is console output right?
<Keybuk> add initctl jobs & initctl events & to the top of it
<Arafangion> That's a good idea.
<Arafangion> Maybe upstart needs a more extreme --debug form which collects as much info as possible in a useful form, saving it to /var/log/upstart.dbg?
<Arafangion> Which remounts the filesystem in rw by default - this is just a debug, so that should be an acceptable special-case?
<Keybuk> there's no really portable way to remount the root rw
<Keybuk> mount -o rw,remount / only works for the 95% case
<Keybuk> (which may be enough)
<Arafangion> 5% of the case where it simply outputs to the screen should satisfy the rest. ;)
<Keybuk> heh
<Arafangion> And besides, those who can't simply remount the root filesystem are probably very aware of that. ;)
<Keybuk> actually, if you can get syslog started early enough, it'll get logged that way
<Keybuk> I often capture --debug by doing init=/bin/bash
<Keybuk> mount -o rw,remount /
<Keybuk> /etc/init.d/sysklogd start
<Arafangion> Not many people run from read-only flash drives or cdr's, and not know about it. :)
<Keybuk> exec /sbin/init
<Arafangion> You don't get the issue with the proc id check?
<Keybuk> or LVM, RAID, etc. that requires more complex bootstrap
<Keybuk> not if you exec it
<Arafangion> Ahh, point.
<Arafangion> This system is actually running from a USB stick, btw. ;)
<Arafangion> Well, if it were working, it'd be running on it. :)
<Arafangion> Going to watch a movie.
<Keybuk> heh
<Keybuk> have fun
<Keybuk> but those should give you some ideas to debug what the hell is goingon
<Keybuk> if it's a kernel bug, I'm going to do a drive-by on some of the developers
<Keybuk> I've had enough of those this month
<Arafangion> It's a fairly recent kernel, too. :)
<Arafangion> At least, it was very recent not long ago.
<Keybuk> oh
<Keybuk> I can guarantee my kernel is more recent than yours
<Keybuk> I don't think the patch is embargo'd until tomorrow :p
<Keybuk> it turns out that upstart's test suite doubles as a proof-of-concept kernel exploit
<Arafangion> Interesting.
<Arafangion> Though, "recent"ness is a flexible concept.
<Arafangion> At the time I built the system, the kernel had been out for...  several minutes. ;)
<Arafangion> Anyway, Stargate time!
<Mogliii> hello, is anyone here who  could tell me how to use grub in ubuntu 7.10 to boot into a certain runlevel, lets say 3
<Mogliii> Default is 2, but appending a 3 in the grub menu item, does not help... Guess its due to upstart
<Mogliii> hello, is anyone here who  could tell me how to use grub in ubuntu 7.10 to boot into a certain runlevel, lets say 3
<Mogliii> Default is 2, but appending a 3 in the grub menu item, does not help... Guess its due to upstart
<Jc2k> Mogliii: a bit of googling suggests:
<Jc2k>   kernel          /boot/vmlinuz-2.6.17-11-386 root=/dev/sda1 ro quiet splash runlevel=3
<Jc2k> is that the syntax you were using?
<Mogliii> no, I used "/boot/vmlinuz-2.6.17-11-386 root=/dev/sda1 ro quiet splash 3"
<Jc2k> can you try it with runlevel=3 then :)
<Mogliii> ok, I will. Guess I am not the only one with that problem... https://launchpad.net/ubuntu/+source/upstart/+bug/85014
<Jc2k> ahh
<Jc2k> the page i found was in spanish but had a similar script
<Mogliii> So I will be gone for 5-10 minutes. Have to try it. Will check back again...
<Jc2k> Mogliii: wait a sec
<Mogliii> ok...
<Jc2k> you will need a workaround script..
<Jc2k> this is the page that suggested runlevel=3...
<Jc2k> http://www.xinug.org/drupal/upstart-runlevel-boot-time
<Jc2k> but i can't figure any of the other bits out..
<Jc2k> you might be better waiting for one of devs, im just a lurker :)
<Mogliii> ok, so it does not work with runlevel=3 on ubuntu 7.10. Thats a good thing, so the problem is not with me :)
<Mogliii> Thank you
<ion_> âThe â#pragmaâ command is specified in the ANSI standard to have an arbitrary implementation-defined effect. In the GNU C preprocessor, â#pragmaâ first attempts to run the game ârogueâ; if that fails, it tries to run the game âhackâ; if that fails, it tries to run GNU Emacs displaying the Tower of Hanoi; if that fails, it reports a fatal error. In any case, preprocessing does not continue.â â Manual for the GNU C preprocessor for GNU CC 1.34.
<Jc2k> lol
<Mogliii> any developer online?
<Keybuk> Mogliii: hello
<Mogliii> hi, are you an upstart developer?
<Keybuk> yes
<Mogliii> I am not sure if you saw the stuff further up, but I am having trouble with passing a runlevel via grub
<Mogliii> What I want to do is to have an entry in grub to start in runlevel 3. I want to execute a backup script and shutdown afterwards.
<Mogliii> So to backup I only have to choose an entry and can go to sleep...
<Keybuk> you were given the answer above
<Mogliii> you mean with that workaround script?
<Keybuk> right
<Keybuk> and you found the bug that says you can't do it
<Mogliii> will there ever be a clean solution for this?
<Keybuk> yes, that's why there's a bug open
<Mogliii> but for longer than march... Ok, I will try to understand how to implement the script...
<Mogliii> Thank you for your time!
<mojo__> Keybuk: it's me again
<mojo__> Keybuk: does upstart relates to shutdown process?
<Keybuk> it does the shutdown process, yes
<mojo__> Keybuk: is there anyway to know if the system reach the safe point ("System now halted") so I can press Power button?
<mojo__> Keybuk: my machine will not have Monitor
<Keybuk> it should say it on the console
<mojo__> Keybuk: the fact I am designing a media player w/o Console or monitor
<mojo__> Keybuk: only the LCD screen
<Keybuk> can it not power itself off?
<mojo__> Keybuk: small 20x4 dot matrix Matrix Orbital one
<mojo__> Keybuk: no
<Keybuk> how come?  that seems to be a bug :)
<mojo__> Keybuk: the fact LCD daemon killed by then so I can't show the output that system is now safe to turn off
<mojo__> Keybuk: heh?
<mojo__> Keybuk: really
<Keybuk> well, most hardware can power itself off now
<mojo__> Keybuk: i compile ACPI, APM
<mojo__> Keybuk: i am using VIA EPA EN12000EG, not power off at all
<Keybuk> did you try shutdown -h -P ?
<mojo__> let me try
<mojo__> said time expected
<mojo__> okat
<mojo__> shutdown -h -P now
<mojo__> works
<mojo__> waiting for it shutting down
<mojo__> hmm
<mojo__> no auto poweroff
<mojo__> it said System Halted
<Keybuk> ok
<Keybuk> I guess you'll need to patch the kernel to notify you in some other useful way
<Keybuk> (the System Halted message comes from the kernel)
<mojo__> k
<mojo__> Keybuk: so... what do i need to debug?
<Keybuk> I have no idea :-)
<mojo__> Keybuk: then know any can help me out here?
<Keybuk> kernel developers
<mojo__> any specific channel for that?
<Keybuk> no idea
<mojo__> Keybuk: fixed
<mojo__> Keybuk: thx, i append acpi=force to the kernel in menu.lst of grub
<JohnFlux> Yo.
<JohnFlux> :)
<JohnFlux> Just want to poke people for  adding a dbus interface to upstart :)
<JohnFlux> s/for adding/to add/
<Keybuk> I already have one
<JohnFlux> hmm, it's already been added?
<JohnFlux> Keybuk: any idea which version of upstart?
<Keybuk> not in a released version
<JohnFlux> Keybuk: but it should be in the next released version?
<Keybuk> yes
<Keybuk> 0.5.0 will be d-bus based
<JohnFlux> Keybuk: what happened to 0.4 ?
<Keybuk> there is no 0.4
#upstart 2007-11-16
<team24> hi
<team24> Is it possible to have a mutiple *and* on start condition. 
<Arafangion> team24: I don't see why it shouldn't be.
#upstart 2007-11-17
<johnf1911> I have an upstart question :)
<johnf1911> I read the getting started guide, I'm using upstart (and upstart-compat-sysv)
<johnf1911> I want mythtv-backend to only start once mysql is running
<johnf1911> since both of these are being run out of init scripts, I assume I'd need to relocate them to /etc/events.d ?
<johnf1911> is there some kind of skeleton events script?
#upstart 2007-11-18
<ion_> http://heh.fi/tmp/kineia-20071118
<ion_> http://heh.fi/tmp/kineia-20071118c The object contains a color gradient from (0,0,0) to (0,0,1). âExposureâ has been set so that the value 0.5 is rendered with 100% brightness. Thus the right half of the object is overexposed. (Glow has been turned off.)
#upstart 2008-11-10
<sadmac2> Keybuk: did you see the audit patch on upstart devel list?
<Keybuk> I've seen it before
<Keybuk> I assume that it is the same one
<sadmac2> Keybuk: I don't know, could be.
<sadmac2> Keybuk: the guy who wrote it wants us to roll it into our rpms. What's your opinion of the patch itself?
<Keybuk> without knowing what audit does, it's hard to say
<sadmac2> Keybuk: fancy logging.
<sadmac2> notting: you can elaborate if you like. I'm not much of an expert either.
<notting> kernel-based audit trail of events
<notting> less forgeable than syslog, i suppose
<sadmac2> so syslog for security crazies
<sadmac2> (not to be mean, I love those guys)
<notting> structured syslog
<notting> (defined events, defined fields, etc.)
<sadmac2> that's nice
#upstart 2008-11-11
<Tronic> 'lo
<mgarces> hi all
<mgarces> any experience using daemontools with upstart?
<mgarces> and djbdns
<suihkulokki> upstart should kinda substite daemontools I thnk
<mgarces> oh
<mgarces> ok
<mgarces> but I'm trying to use djbdns with fedora9 which uses upstart
<mgarces> any idea?
<sadmac2> mgarces: you could just put it in as a regular sysvinit script
<sadmac2> sysv emulation is still the major workhorse in fedora
<mgarces> but djbdns need daemontools to work
<sadmac2> mgarces: that you could also simply run as a sysvinit script
<mgarces> im very confused :P
<sadmac2> mgarces: I don't really see how upstart effects you here. Just do it the way you would have done it under sysvinit
<mgarces> daemontools does not understand upstart
<mgarces> and in order to install it, i need sysviinit
<mgarces> nevermind
<mgarces> going to try in another way
<mgarces> tanx 
#upstart 2008-11-12
<tesseracter> wow, its here.
<tesseracter> im trying to use bootchart, but dont trust their instruction to add init=/sbin/bootchartd to my kernel menu. should i trust them, or are things different?
<tesseracter> i'll chill here for a while, in case someone comes back...
<notting> has upstart always run scripts with -e and i just didn't notice?
<ion_> Probably.
<Keybuk> yes
<sadmac> tesseracter: the instructions are right
#upstart 2008-11-13
<sadmac2> Keybuk: In the new model, we remove "stop on" events, but I think it might be useful to have a "fail on" so that when pid 1 notifies the state machine that a process fell over we can reflect this as an event
<Keybuk> ?
<sadmac2> Keybuk: so where stop on says "stop this service when X happens" fail on would say "when X happens, the service is no longer running to to extenuating circumstances. Please update the state machine to reflect this"
<sadmac2> we could even offer a script to run when this happens to cleanup any leftover post-crash bullshit (dead pidfiles, broken /var data, etc)\
<Keybuk> what would be an example use?
<sadmac2> Keybuk: for the fail on event in general? just about anything. We start apache, apache crashes, we find out about it by an event and drop the apache state without running its falling edge code.
<Keybuk> but we don't
<Keybuk> apache crashes directly affects the job
<Keybuk> it's not an event
<sadmac2> Keybuk: if we have a separate pid 1 service mananger and state machine, then we have to communicate the change somehow to cause that effect.
<sadmac2> Keybuk: this is one way of doing that
<arekm> hi, I'm trying to use mingetty with upstart but it fails with: /sbin/mingetty[4965]: tty1: no controlling tty: Operation not permitted
<arekm> mingetty tries to do: ioctl (fd, TIOCSCTTY, (void *) 1) == -1
<arekm> and is called just by: exec /sbin/mingetty --noclear tty1
<arekm> upstart 0.5
<arekm> hm, NEWS seems to be good source of info. Found "session leader" directive needed
#upstart 2008-11-14
<sadmac2> Keybuk: around?
#upstart 2008-11-16
<MarcWeber> Is upstart the current dev branch?
#upstart 2009-11-09
<vsMS> hi! can someone help me by an upstart initscript?
<vsMS> I need something like a firstboot to be ported from sysVinit to upstart
<vsMS> but i don't know how things are going when ordering these scripts
<Keybuk> I don't know what that is
#upstart 2009-11-10
<oly> can anyone tell me what happens when you do stop jobname ? ie what events are sent 
<oly> current my job starts but does not stop so guessing it need to handle specific events
<oly> is there a way to debug upstart scripts i am running stop scriptname and its locking the terminal 
<oly> i can press ctrl + c to cancel but how can i find why it never stops its probably my program but i want to modify it to work correctly ?
<sadmac> oly: locking the terminal is rare. Are none of the other vts working?
<oly> sorry vts ? i am new to upstart
<sadmac> oly: other virtual terminals
<sadmac> oly: ctrl+alt+f(2-6)
<oly> yeah its not locking like that it just does not return to the prompt
<sadmac> oly: ok, open another terminal
<oly> yep
<sadmac> oly: initctl list should give you something to go on
<sadmac> oly: hopefully you'll get a pid from there. Then you can attach gdb to it and go nuts
<oly> usm start/killed, process 22445 thats what it says 
<oly> and its still sat at the prompt in the other terminal trying to start
<oly> there any examples around for a python daemon script 
<oly> as my program is a python web server basically 
<sadmac> oly: start/killed means it was planning on coming back up...
<sadmac> oly: try kill -9 22445
<oly> says theres no such process
<oly> which i have just confirmed with ps -A | grep 22445
<sadmac> oly: ok, that's a problem...
<sadmac> Keybuk: any ideas? ^^
<oly> i guess its something i have done i have been trying things with the scripts to get it working 
<sadmac> oly: does your job have pre-stop/post-stop scripts?
<oly> nope at least not now
<JanC> oly: http://www.python.org/dev/peps/pep-3143/ might be the best place for info about writing a unix daemon in python
<oly> okay i have a lot of that code, is there anything on the upstart side for a program like that ?
<oly> or can some one recommend me a good exmple that should work with that sort of program
<oly> once i know the upstart script is correct i can start checking my code 
<oly> at the moment prestart echo does not even print
<oly> guessing thats to do with the usm start/killed message
<oly> is there any way to clear that ?
<JanC> http://pypi.python.org/pypi/python-daemon/ --> a library implementing correct daemon behaviour
<sadmac> oly: if the task is dead and gone then upstart should be moving along
<oly> those links are great think i used them to write it originally 
<oly> can i reset upstart so it rechecks some how ?
<sadmac> oly: try doing stop usm again
<sadmac> ugh. I need to get the code in front of me...
<oly> usm stop/killed, process 22445
<oly> now says already stopped
<oly> perhaps it just takes a very long time to stop
<sadmac> oly: it should be stop/waiting
<sadmac> the process is gone, but the state machine isn't progressing
<sadmac> and I forget what's supposed to happen in the Killed state so I don't know what to look for
<sadmac> oly: check ps for <defunct> entries
<oly> none related only ones are for chromium
<Keybuk> usually means that upstart has the wrong pid for the process
<Keybuk> ie. expect fork when you meant expect daemon
<sadmac> Keybuk: but it got to the running state. It didn't hang until he stopped it
<Keybuk> was the pid right when it was in the running state?
<oly> unknown and cant restart now 
<oly> actually will just check that 
<oly> yeah because its not cleared from upstart it never starts now
<sadmac> upstart should really deal with these kinds of crap situations better, though I think proc connector will make most of that irrelevant
<oly> thanks for the help, useful info anyway
<Keybuk> also check that the ppid of your daemon is actually 1
<Keybuk> sometimes you end up watching a pid that has a different parent
<Keybuk> if ppid != 1, then upstart will never know it died
<Keybuk> sometimes Upstart follows the wrong fork, for example:
<Keybuk>   expect fork
<Keybuk>   script
<Keybuk>     OPTS=$(cat /etc/default/options)
<Keybuk>     exec my-daemon $OPTS
<Keybuk>   end script
<Keybuk> in that case, upstart ends up with the PID of "cat"
<Keybuk> and since cat is a child of the shell, the shell gets the SIGCHLD not upstart
<Keybuk> so it fails
<sadmac> its kind of astonishing how many ways this thing can break
<oly> yeah well i guess i should have used ecpect daemon instead of fork from a comment further up 
<oly> currently my daemon is not running and nothing with the pid upstart has is running
<Keybuk> daemon means "forks twice"
<Keybuk> not once
<sadmac> unfortunately posix doesn't seem to offer a version of kill that lets you load the arguments, so you can't send a manual CLD and get it going again
<oly> hum could this be an issue my program has child daemons which are still running
<sadmac> oly: no, upstart likely lost those
<oly> i did not think upstart would care about those 
<sadmac> it won't
<oly> killed them anyway 
<oly> also can upstart handle my app if i dont start it as a daemon ie so that it would lock the terminal 
<oly> as i can do this as a test by passing a prameter to the program
<sadmac> oly: it could work
<sadmac> oly: actually no, upstart would grab the initial process and fall over immediately
<oly> okay
<oly> well thanks for the help will try again a bit later i think
<oly> if anyone happens to think of a way to clear upstarts current list other than rebooting let me know :)
<sadmac> oly: kill -HUP 1, but that will make it forget /everything/ its managing
<oly> okay that will do for now 
<oly> at least while testing
<oly> reboot each time would be more of a problem 
<sadmac> exploiting bugs against bugs. isn't life grand?
<oly> lol, thats a bug is it :p
<oly> think upstart needs a new option to force remove a process from its list by id
<sadmac> oly: kill -HUP re-executes init. Technically this should have no noticeable effect.
<sadmac> oly: maybe. It'd be better if it just managed services better (and it will.)
<oly> yeah that would be better, but some times it nice to have a fall back option in place
<Keybuk> oly: Upstart should never lose the process
<Keybuk> I'd rather spend time fixing those bugs
<Keybuk> otherwise some idiot will come up with something that deliberately tells upstart to lose pids because of some other problem, etc.
<oly> fair enough
<oly> but it seems if i for example writes bad code i coudl always break it even if its not intentional
<oly> unless it keeps following the path of my programs forking 
<Keybuk> right, that's the correct fix ;)
<oly> ah okay :p
<sadmac> oly: eventually upstart will track everything your program forks off until one of them calls setsid.
<sadmac> oly: this has just taken some kernel infrastructure (now in place).
<oly> aha that would be good 
<oly> what would happen if you branched of seperate programs from it ?
<sadmac> oly: they would call setsid()
<sadmac> oly: that's just good unix practice
<oly> my program launches itself then two sub process as different userts which it communicates with using ipc
<oly> aha fair enough
<Keybuk> oly: ah
<Keybuk> but in that case, you want upstart to know about all three pids
<Keybuk> you might even want it to, if one of the pids dies, to deliberately send SIGTERM to the other two so that the process can be respawned
<oly> maybe, although the main program currently manages the other processes so thats not really important
<Keybuk> ah, but if it segfaults ...
<oly> i guess, but for now i would just be happy to stop and start the main program with upstart :)
<sadmac> Keybuk: to an extent thats useful. In reality to do that right the daemon would have to tell upstart which pids are what and what they mean. If an apache worker dies we ignore it. If the apache master dies we need to kill the workers.
<oly> might as well create it for modern linux system as it requires a lot of modern software to function :p
<Keybuk> sadmac: sure
<sadmac> Keybuk: I'm guessing libupstart will return for some of this. A lot of apps will want to give little hints to upstart and won't want to deal with the whole apparatus of their native dbus API to do it.
<sadmac> Keybuk: (naturally libupstart would be a wrapper around a few nih_dbus calls, not the old protocl)
<Keybuk> that kind of thing, yes
<JanC> I don't know the exact way apache works, but if apache master dies, won't you want the workers to finish the current request first (or does it need the master for that)?
<Keybuk> JanC: that's more like ssh ;)
<Keybuk> better question, would you want to restart the master while the workers are still there?
<oly> i know i would certainly want my child processes to finsh 
<oly> as they have a queue of commands to pass through
<Keybuk> there are enough interesting scenarios here that knowing about "workers" is a good idea
<oly> my program is not that intrested in the child processes as long as they are running, because it just writes commands to a text file and the children act on them 
<oly> so they can carry on running after the parent has finished in fact if they did not the system would probably be a lot more unpredictable
<oly> if any of this info is of any use :)
<sadmac> oly: you're using a text file as a command spool?
<oly> yeah basically 
<sadmac> oly: ...upstart aside you may want to re-examine your programming techniques
<oly> it queue up the commands because some can take a lot of time so they must not block the original program 
<oly> why is there a better way than ipc type method
<oly> this was the only way i could find as all 3 program run as different users so communication between them was a pain 
<Keybuk> nothing wrong with that style
<Keybuk> it's just using the filesystem as shared memory
<Keybuk> tried, tested and true UNIX way of doing things, that
<sadmac> Keybuk: when we have...shared memory
<Keybuk> sadmac: which is, in Linux, implemented as a filesystem
<Keybuk> in which you create files
<Keybuk> that you use as spools
<sadmac> or for that matter, pipes and unshared memory to spool from
<Keybuk> pipes are two-way only
<Keybuk> oly said he has two workers and a master
<Keybuk> so fifos don't work
<oly> the master works as root which breaks of a web server into a restricted use account, and send info back to the program in the root account 
<oly> thats the type of thing i needed
<sadmac> Keybuk: there is a way. It involves some descriptor passing (easier to do with threads but very possible with processes).
<Keybuk> sure
<sadmac> I was starting to write a web server that did this.
<Keybuk> but why not just use a file? :p
<sadmac> oly: are you using mmap?
<oly> nope not come across mmap
<sadmac> oly: ok you should at least be mmaping the file.
<oly> okay whats that do then in quick terms :p
<oly> i will research at some point
<sadmac> oly: It lets you access the file as though it were ram
<oly> sounds intresting
<oly> probably would have saved me a load of work writting a parse by sounds of it :p
<JanC> oly: http://docs.python.org/library/mmap.html
<JanC> ;)
<oly> hum, i can think of other uses for that in my program as well 
<oly> :)
<oly> thanks for that 
<Keybuk> ugh
<Keybuk> mmap is going to hurt them
<Keybuk> my hobby: finding programs that "cleverly" mmap() files into memory, and truncating the files under them :p
#upstart 2009-11-11
<dmart> Quick upstart question in Karmic:
<dmart> I want to hook in a script to run on shutdown which runs as late as possible, but strictly before filesystems are unmounted.
<dmart> Is is possible to do that with an upstart job, or do I need a SysV style link from rc[06].d?
<sadmac> dmart: its likely possible, but its specific to Karmic's setup of upstart, and thus should be asked in an ubuntu-specific channel
<dmart> OK
<dmart> One related question is whether it's possible to put "before event" constraints in upstart jobs.  This would provide a framework for doing the kind of thing I'm talking about, but I couldn't see a way to do it.
<Keybuk> not before event, no
<dmart> Is there any plan to add such a thing?  This might make it easier to incorporate things like filesystem unmounting within the upstart framework.
<Keybuk> sort-of
<dmart> There might be a straightforward workaround that I'm not thinking of, of course
<ion> The sysvinit script will die and become an Upstart job or part of one. Then you can nicely insert your own stuff based on the events emitted by said job.
<dmart> My concern was that if you have some random tasks X, Y, Z which need to run on shutdown but before filesystem unmounting, then the unmount job must list them all: start on (stopped X and stopped Y and stopped Z)
<Keybuk> no
<Keybuk> X can be start on starting unmount
<dmart> Are the jobs serialised... how do you ensure that the unmount job does not really run until X finishes?
<Keybuk> they're serialised
<Keybuk> jobs can block each other
<dmart> Hmmm, OK.  Do you know if there's a good example somewhere I could look at?
<Keybuk> man 7 starting
<dmart> Keybuk: Ah, I seee.  Sorry for the newbie questions... I'm still finding my way around the upstart man pages.  Thanks!
<dmart> Just to check my understanding, if I make a job start on (runlevel [09] and starting rc), will that have the desired effect of a job which runs on shutdown but before the final teardown done by rc?  Is start on starting rc RUNLEVEL=[06] equivalent?
<dmart> (I mean [06], not [09])
<Keybuk> actually
<Keybuk> you can just do
<Keybuk> the latter
<Keybuk> start on starting rc RUNLEVEL=[06]
<Keybuk> because /etc/init/rc.conf has export RUNLEVEL in it
<dmart> Keybuk: OK, thanks for confirming.  I think I understand much better now :)
<Berteun> hello someone here? :)
<JanC> no  :P
<Berteun> hi, i'm running into a problem which might be related to upstart
<Berteun> i've just installed karmic 9.10 under a xen domu and now the system hangs, just as described here: https://bugs.launchpad.net/ubuntu/+bug/398214
<Berteun> the bootlog is here: http://launchpadlibrarian.net/35544120/ubuntu910log-2.txt
<sadmac> Berteun: I'd advise you to CC yourself on that bug then
<Berteun> if i strip my /etc/init/ and remove quite a few scripts, it ends with init: event_finished: Finished startup event
<Berteun> yeah okay
<Berteun> and i suspect mountall is the culprit
<sadmac> Berteun: you should probably comment on it too
<Berteun> but that's only a vague guess
<Berteun> so i'd like to explore that a bit more
<Berteun> but i'm rather new to upstart
<Berteun> so i'm more or less 'lost' 
<sadmac> Berteun: if you want general information about upstart internals you're in the right place. As far as solving your issue, though, the launchpad bug is where you should be.
<Berteun> okay
<sadmac> There should probably be some document to link to about how upstart works. None has materialized though...
<Berteun> yeah, i was looking around for that a bit, i found out about the --debug and --verbose parameters
<sadmac> Berteun: you should look over all of the manpages that ship with upstart as a starting point. I believe there's one or two that cover the mechanics.
<Berteun> okay
<Berteun> is it also possible to start upstart if you boot with init=/bin/bash ?
<sadmac> Berteun: you'd have to then "exec /sbin/init"
<JanC> "man 5 init" gives some info about how upstart works
<Berteun> but then it starts all its jobs again it thinks it can do (and it hangs) 
<JanC> or at least enough to understand the upstart config
<Berteun> it appears to be the mountall executable which causes the problems, is that applicable to this channel too?
<sadmac> Berteun: technically not, but Keybuk wrote mountall, and afaik this is kind of the defacto place where it gets discussed still
<Berteun> okay :)
<sadmac> Keybuk: come forth and be pestered
<Berteun> I just filed a bug and I'm not demanding it be solved right here and right now, just if some info is missing in the report: https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/469985
<sadmac> Berteun: you should point out in the original bug that it may be related
<Berteun> I did that.
<sadmac> cool
<Berteun> i've got it
<Berteun> probably
<Keybuk> what did you got?
<Berteun> it's an incompatiblity 
<Berteun> mountall uses pipe2 which is unavailable in 2.6.26
<Berteun> which is wrapped in NIH_ZERO( )
<Berteun> hence it loops until it is succesful but it won't every be, because it is not there ;)
<Keybuk> oh
<Keybuk> right
<Keybuk> mountall really needs .29 I think
<Keybuk> probably even .31
<Berteun> so basically ubuntu 9.10 is incompatible with dom0 lenny
<Berteun> to make a long story short :)
<ion> Wait... The hostâs kernel version matters?
<Berteun> well not really, but since ubuntu itself does not provide domU xen kernels the obvious choice is to use the debian lenny kernel.
<Berteun> which most people do
<Berteun> and then it does not work for an not enterily obvious reason
<Berteun> debian uses 'xen old style' not the PvOps
<JanC> ah, so I'm right it's a kernel feature mismatch somehow âº
<Berteun> Yeah, well, it was a bit of a risk of course to try to run an older kernel, but forward porting xen changes is not really my cup of tea ;)
<Berteun> i'll make a note at the bug page, i'm not the only one it seems
<dgtl> hi there
<Keybuk> oh
<Keybuk> I'm evil
<Keybuk> ion: my --handover/--takeover stuff works :)
<Keybuk> start plymouthd
<Keybuk> plymouth --show-splash gives you the DRM/FB animation
<Keybuk> when, when about to start X
<Keybuk> plymouth --handover
<Keybuk> and at the top of the gdm Init
<Keybuk> plymouth --takeover
<ion> Awesome. :-)
<Keybuk> the splash pauses, X inherits the image
<Keybuk> then begins animating again in X :)
<ion> Would it be possible to skip --handover and have plymouth automatically pause at the last possible moment when it notices X has taken the framebuffer?
<Keybuk> I don't think it works that way :)
<Keybuk> it isn't using the framebuffer
<Keybuk> it's using the DRM/DRI interface
<Keybuk> so it's possible it'll lock X out
<ion> Ah
#upstart 2009-11-12
<sadmac> Keybuk: what are you doing with plymouth?
<Keybuk> sadmac: replacing usplash and xsplash with it
<sadmac> Keybuk: I guessed. :) What's this new functionality you've added?
<Keybuk> there's a debug x11 renderer in it
<Keybuk> I turned it into a proper "fullscreen on each head" renderer
<Keybuk> and added the code to let you pause the display
<Keybuk> start X
<Keybuk> then resume animating on a new X window
<sadmac> Keybuk: I haven't noticed x/gdm taking long enough to start for me to want that, but go for it :)
<Keybuk> gdm takes 2-3 seconds
<Keybuk> but it's GNOME that's the POS here
<Keybuk> auto-login takes 6-15s after X is started
<sadmac> Keybuk: yeah, rstrode/some others said that they might need to beat that down (again, apparently there's been a lot of yoyoing in gnome startup time in the past).
<Keybuk> yeah
<Keybuk> but then they start mewing about "It's all I/O because on a cold cache"
<Keybuk> and it so isn't
<Keybuk> because ureadahead warms the cache up very nicely, and it still takes that long (with no disk activity)
<Keybuk> bloody race conditions
<Keybuk> turns out that if you don't idle the plugin
<Keybuk> then it's still going to animate after you dlclose() it
<Keybuk> which crashes plymouth while X is starting
<Keybuk> which forces the console into KD_TEXT
<Keybuk> which upsets X too
<sadmac> Keybuk: have you been in touch with Ray?
<Keybuk> Ray has been very helpful :)
<Keybuk> http://cgit.freedesktop.org/plymouth/
<Keybuk> note top three commits ;)
<sadmac> I take it those were at your request?
<sadmac> ah, detailed message explains all
<sadmac> Keybuk: so how are y'all feeling about plymouth. Still kicking around other options?
<Keybuk> y'all doesn't happen until next week
<Keybuk> I'm trying to make plymouth work, so that when everyone's together next week, I can go "look, it works, it's perfect, now can we kill usplash?"
<sadmac> ahh
<Keybuk> (and xsplash)
<sadmac> Keybuk: what about the KMS thing? Just not bothered by it, or does the new nvidia stuff cover enough of your users now?
 * sadmac was pleased that plymouth started working graphically in F12
<Keybuk> plymouth works with vga16fb
<Keybuk> I think I've sold Mark on the idea that he can have a b/w 16 colour logo for the non-KMS crowd
<Keybuk> (ie. just like our usplash theme)
<sadmac> Keybuk: and it springs to life once you shift it on top of X?
<Keybuk> exactly
<sadmac> wayland is much more famous as a town (several towns really) than as a windowing system
<Keybuk> yes
<Keybuk> I was noticing your town naming scheme
<sadmac> Keybuk: I'm not sure if it was a RH-initiated project, but Beryl is a road not far from the Raleigh office. It has a waffle house on it.
<sadmac> I don't think there's any official policy about naming things after places, and I also don't believe Wayland was produced under orders from RH anyway.
<sadmac> weird little groupthink thing we have going I guess.
<Keybuk> yeah
<Keybuk> like our one of "open a dictionary at U and start reading until you find one"
<Keybuk> completely unofficial
<sadmac> heh
<Keybuk> but when stuck for a name, it's what most people do :)
<sadmac> I'm really good at coming up with project names
<Keybuk> I'm terrible at it
<Keybuk> (upstart was very much an "open the dictionary at U" name)
<Keybuk> ureadahead was "argh, can't think of a name, ok U <whatever it was>"
<sadmac> Keybuk: just about any time I think of a project idea I create a folder in ~/coding with that name. I have a lot of empty folders with really awesome-sounding names.
<Keybuk> haha
<sadmac> some of them at least have a .git folder
<sadmac> http://www.npr.org/templates/story/story.php?storyId=120271945
<sadmac> Open source limbs?
#upstart 2009-11-13
<a_little_tired> Hey, is anyone here?
<btm> working on debugging an issue where bonding is started before the interfaces are ready in karmic and it has been implied that upstart may be involved (same as described here: http://ubuntuforums.org/showthread.php?t=1311837). Any hints as how to create a dependency from the bonding configuration in interfaces to wait for the interfaces to come up?
#upstart 2009-11-14
<frog-o> dose upstart have anything to do with module loading 
<wasabi__> Question: I have a job that needs to stop by running a command and waiting for the process to exit, but never sending TERM to the process.
<wasabi__> I think expect stop is the closest, except I'm not using SIGSTOP
<wasabi__> Oops
<ion> Add a pre-stop script that runs the command and waits for the process to exit.
<wasabi__> Ahh. I can wait. Duh.
<wasabi__> Cool. So. Here's a harder one. I have a set of services which I need to attempt to shutdown, but if they fail to shutdown, I need the system back up. Can we do this yet? :0
<wasabi__> (VirtualBox VMs)
<wasabi__> (they could fail to respond to acpipoweroff
<Keybuk> wasabi__: yes, in the pre-stop
<Keybuk>   if failed_to_shutdown
<Keybuk>   then
<wasabi__> cool
<Keybuk>     start
<Keybuk>   fi
<Keybuk> ;)
<wasabi__> does env support "" around values?
<Keybuk> yes
<wasabi__> Hmm. Getting close.
<wasabi__> Got the job to start... but there's probably some unknown of fork
<wasabi__> And if 'start' is invoked, and the job actually does succeed to shutting down later, does it come back? I suppose respawn effects that?
<wasabi__> vm-station-1 main process (28695) killed by TERM signal
<wasabi__> grrrr
<wasabi__> oh i see
<wasabi__> pre-stop failed
<wasabi__> if pre-stop fails, shoudl stop continue?
<Keybuk> no
<Keybuk> pre-stop fails doesn't affect anything
<wasabi__> hmmm.
<wasabi__> main process terminated with status 5.  weird. it's just exec sudo, followed by a command that does not fork.
<wasabi__> running it as root works.
<wasabi__> Keybuk, when you getting into Dallas?
<wasabi__> oh i know. sudo isn't staing alive.
<wasabi__> hmmm
<wasabi__> Variables are expanded on exec stanza's, I assume
<wasabi__> Hmm. So sudo is forking the task off, but it's getting the console, so you can't tell
<wasabi__> Hmm. Nope.
<wasabi__> sudo is execing
<wasabi__> could i have broken upstart? I have a job that just blocks on 'start'
<wasabi__> ISI\jhaltom@station-1:/etc/init$ sudo status vm-station-2
<wasabi__> vm-station-2 stop/killed, process 9401
<wasabi__> no 9401 exists
<Keybuk> wasabi__: sunday evening
<wasabi__> so tomorrow
<ion> http://heh.fi/tmp/workaround-upstart-snafu
<ion> ./workaround-upstart-snafu 9401
<ion> :-P
<wasabi__> so it's a known issue?
<ion> Upstart doesnât really handle forking children very well at the moment. Your job is doing something else than what Upstart expects. The 0.10 release will fix that.
<Keybuk> today, I mostly hate compiz
#upstart 2009-11-15
 * ion imagined the Fast Show âthis week, I âave been mostly eating...â character saying that.
<wasabi__> So I wonder if it makes sense to make instance jobs for starting virtual machines, and one job that starts instance jobs
<Keybuk> ion: that's the exact way you should have imageined it ;)
<wasabi__> So... advice. I think I know how I'll proceed on this, but I want input none the less. Writing a init set for VirtualBox. Basically, system has a set of VMs which are configured to be managed by init script set. User of the system can add new Vms to the set and stuff. He has to be able to control individual VMs with upstart. Because that rocks.
<wasabi__> Two ways I can come up with; one, make a instance job, with variables for selecting the VM.
<wasabi__> That's interesting. It has the downside that I need another job to start the instance jobs.
<wasabi__> Which might be okay!
<wasabi__> It also has the benefit that the user can start any VM by just starting an instance ad hoc
<wasabi__> Second, let the user add .conf files underneath /etc/init/virtualbox/
<wasabi__> That has the downside that the user has to write said files, or some utility does. It has the upside that the VMs are documented within the init system.
<wasabi__> For the instance thing I'd have a file /etc/virtualbox-start.conf or somethign which simply listed the instances to run at boot.
<wasabi__> Which the master task job would bring up
<ion> naurun
<wasabi> Hmm. So I have pre-stop successfully terminating the process. But after it terminates it, upstart respawns it. Heh.
<wasabi> normal exit. aha.
<wasabi> nope.
#upstart 2010-11-17
<Keybuk> meh
<Keybuk> don't you just hate it when you forget about something?
#upstart 2010-11-18
<bancal> Hi! Let me ask one question...
<bancal> I'm preparing an upstart job that has to be executed on shutdown (or reboot). That job absolutely needs the network and local drives to be read-write accessible.
<bancal> I can't find any "require network" instruction in upstart documentation.
<bancal> After some tests, it seems to be ok with these access, but how could I be sure that those resources won't be shut down before or during my job to run?
<bancal> It's running on Ubuntu 10.04LTS.
<toabctl> i use upstart in debian squeeze and wrote my own upstart script, but i always get:
<toabctl> Setting up test (0.1+2814M-1) ...
<toabctl> Usage: /lib/init/upstart-job {start|stop|restart|reload|force-reload}
<toabctl> insserv: warning: script 'test' missing LSB tags and overrides
<toabctl> insserv: Default-Start undefined, assuming empty start runlevel(s) for script `test'
<toabctl> insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `test'
<toabctl> any ideas how to fix this?
<toabctl> it's this bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593348
<JanC> bancal: I suppose that job is a "task"?  I think it should have "start on stopping networking RESULT=ok" or something like that (see "man 7 stopping")
<bancal> Yes it's a task
<bancal> I did : 
<bancal> start on starting rc RUNLEVEL=[06]
<bancal> Which seems to work ... I can't be sure if it's guaranteed to work...
<bancal> "start on stopping networking RESULT=ok" ... is that not to late in the shut down process?
<JanC> yeah, probably not networking, but something about network filesystems
<JanC> with your solution it will not run if you down the network for some other reason than shutdown, which is maybe what you want
<bancal> Thanks for your interest, sorry but I really have to leave now (will be back tomorrow 8AM - switzerland) I keep it connected in case you want to write some more ...
#upstart 2010-11-20
<rslifka> hey guys, having some difficulty getting ulimit -n set via upstart
<rslifka> i see the limit stanza here http://upstart.ubuntu.com/wiki/Stanzas
<rslifka> when i output ulimit -n inside of the spawned service, still says 1024
<_SKiTZO> i realized by now that with upstart "there is no spoon" but for an old geezer like mee i need the comfort of being able to assign stuff to a runlevel. can someone please tell me how i can turn off gdm when i set runlevel3 with upstart on ubuntu 10.10 ?
<_SKiTZO> you all are evil robots, i'm sure of it.
#upstart 2011-11-15
<ion> Ah, i was just misdiagnosing. su was the culprit: it sent SIGKILL too soon after SIGTERM. Works with sudo.
<broder> if i have a task that's "start on starting something-else", something-else shouldn't actually be started until my task completes, right?
#upstart 2011-11-17
<SpamapS> broder: re start on starting and task, thats correct, the point of task is that events causing its start will not be unblocked until the task is entirely done
<daisy> hi - im trying to work out how to run a custom script on tty1 instead of login. Ive changed /etc/init/tty1.conf's exec line to exec /usr/bin/myscript, but its just a blank screen with the cursor flashing ( the script works, is in the right place and is executable ) - any ideas?
<daisy> using ubuntu, on upstart 1.3
<daisy> ah, 'start tty1' claims to start the tty1, 'stop tty1' says no such instance, so i assume its not running my script
<daisy> ah ha
<daisy> fixed it, added 'console output'
#upstart 2011-11-18
<lixus> hi, i need an upstart script that simply logges the time when my desktop was powered on and when it shuts down
<lixus> i am using this script http://pastebin.com/CmvtE0y8
<lixus> it works for power on but not for shutdown
<jhunt_> lixus: try "start on filesystem or runlevel [06]" and remove the "stop on"
<jhunt_> lixus: then, replace the post-start and post-stop with a simple "script" that looks at $UPSTART_EVENTS. If that variable contains "filesystem", the job was triggered on boot, else shutdown.
<jhunt_> lixus: I'll add something along those lines to the cookbook the next time I update...
<lixus> jhunt_, thanks, i'll try that. but then my post-stop section is obsolet ?
<lixus> forget my last message
<lixus> some elay in my irc client
<SpamapS> jhunt_: actually I think he'd want start on filesystem or starting rc RUNLEVEL=[06] .. start on runlevel [06] will race with the actual shutdown.
<SpamapS> jhunt_: not that I think his process will take > 10 seconds.
#upstart 2011-11-19
<Hobart> does upstart have any way to single step through scripts?  (that is, something like "About to run script XXXX, hit Enter to continue").  (If the answer is "no", that would help too)
<Hobart> Trying to find what program is screwing with me during bootup
<broder> not currently, but there's been discussion about doing that for a while
<broder> you should be able to do it with a sufficiently clever job with a "start on starting" block
<broder> (i.e. just "start on starting", since that will get triggered once for every job)
#upstart 2012-11-12
<_Tristan> Hi. How can I start a job right after lightdm starts?
<Jordan_U> I've found another Ubuntu user who seems to be encountering a bug where PID 1 is not reaping one of its children (the first user, who I asked about here yesterday, filed this bug report: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1077579 ).
<Jordan_U> In both cases the process in question has init as its parent, and is in "Zl" state according to ps (Defunct and multi-threaded).
<Jordan_U> Should they file a new bug report, or simply mark themselves as affected by the current bug report?
#upstart 2012-11-13
<SpamapS> Jordan_U: I'd say open a new bug report and mention it in the comments of the old one as a potential duplicate. Sometimes dupes can be useful in comparing differences while fixing the bug.
<Jordan_U> SpamapS: Thanks.
#upstart 2012-11-14
<jamescarr> %
<jamescarr> hey guys, I'm having some problems getting the following init script to run: https://gist.github.com/b23e5c2469400d1ca9a4
<jamescarr> any guidance?
<jamescarr> when I run the exec command manually, it works
<SpamapS> jamescarr: first off, 'shutdown' is not an event, so this will never be stopped
<SpamapS> jamescarr: other than that it looks somewhat normal. hm
<SpamapS> jamescarr: here's how I would write that job tho
<SpamapS> jamescarr: http://paste.ubuntu.com/1358381/
<jamescarr> SpamapS: thanks
<jamescarr> SpamapS: still exits with a status of 1 :(
<jamescarr> Confused... I've set these up tons of times before
<jamescarr> when I copy the exec command and run it, it works
<jamescarr> what could I be missing?
<SpamapS> jamescarr: what version of upstart? if its 1.4 or later, you'll have a log in /var/log/upstart/$jobname.log
<jamescarr> frak
<jamescarr> I got it
<jamescarr> dammit!
<SpamapS> jamescarr: you forgot to hook up the doll?
<jamescarr> ownership is off
<jamescarr> still shouldn't make a difference, let me check on that
<jamescarr> not it, still failing
<jamescarr> upstart --help
<jamescarr> version 0.6.5 of upstart
<SpamapS> ah ok that one you'll need to pipe to logger or something
<jamescarr> advice on that?
<jamescarr> %
<SpamapS> just add 2>&1 | logger -t foo  to the exec line
<jamescarr> Nov 14 11:05:56 ultipro-api ultiproapi: sudo: sorry, you must have a tty to run sudo  :-D
<SpamapS> AHa
<SpamapS> jamescarr: http://upstart.ubuntu.com/cookbook/#changing-user
<SpamapS> jamescarr: read that, it may help
<jamescarr> SpamapS: thanks, got it running
<SpamapS> jamescarr: cool
<jamescarr> no longer writes to log, but I think that is a separate issue 
<jamescarr> I mean, no longer writes to my app log
<jamescarr> SpamapS: is there something I might have off with this? 
<jamescarr> exec su -s /bin/sh -c "/usr/local/bin/bundle exec /usr/local/bin/ruby token_service.rb >> /home/ultipro/ultipro-api/shared/log/token_refresh.log 2>&1" ultipro 
<jamescarr> I expected >> /home/ultipro/ultipro-api/shared/log/token_refresh.log 2>&1 to populate the log
<jamescarr> with STDOUT from the ruby script
<jamescarr> it used to do it when running as sudo
<jMCg> Something seems off: we just did a reload (multiple times, actually) on upstart 1.5 of a tomcat process, and it seems to have restarted it instead
<jMCg> Which is bad, because that means 45 sec downtime (each time) and cutting off of online user sessions
<jMCg> false alarm.
<jMCg> JVM sends shutdown hooks when it receives SIGHUP, which I consider to be exceptionally inane.
<SpamapS> jMCg: reload sends SIGHUP. If tomcat restarts on HUP, thats why
<SpamapS> jMCg: oh, and now I read your false alarm, so disregard ;)
<simensen> i'm having a really horrible time with upstart today. :(
<simensen> i always seem to struggle with it. debugging on a remote system is very painful. i'm getting "[  783.498605] init: uploader-gunicorn main process (1650) terminated with status 1" and that is about as much info as I can get about what is wrong.
<simensen> all attempts i've made to try and get something to output to a file have failed. i have yet to get anything to write to anything in /tmp/
<simensen> uploader@precise64:~$ sudo start uploader-gunicorn
<simensen> uploader-gunicorn start/running, process 1665
<SpamapS> simensen: what version of upstart? version 1.4 and later log to /var/log/upstart (Ubuntu 12.04 should log there for instance)
<simensen> how do i find out which version of upstart i am running? and yes, i finally found some reference to /var/log/upstart
<simensen> https://gist.github.com/09b1f607c6a5955164d3
<simensen> it now looks like i'm running into the problem of LOGFILE actually looking like $LOGDIR/gunicorn.log on my commandline.
<simensen> i think this is actually what gets run: /opt/uploader/current/ve/bin/gunicorn -w 3 -b 0.0.0.0:996 -u uploader -g uploader --log-level=debug um.wsgi --log-file=$LOGDIR/gunicorn.log
<simensen> if there is a way for me to do that it would be awesome to know. i just assumed this would work. :-/
#upstart 2012-11-15
<SpamapS> simensen: env statements are not expanded
<SpamapS> simensen: so just be literal about the LOGFILE instead of using LOGDIR and it will work
<SpamapS> simensen: very old bug btw, but #328366
<SpamapS> bug #328366 rather
 * SpamapS kicks the bot
<SpamapS> https://bugs.launchpad.net/upstart/+bug/328366
<xnox> some flamewars just simply.... do.... not.... die and keep on being resurrected
<SpamapS> xnox: we just like to watch stuff burn
<xnox> heh
#upstart 2012-11-16
<jMCg> dpkg -S /etc/init/container-detect.conf claims it belongs to upstart, but upstart doesn't have that file.
<jMCg> Where do I find it?
<jodh> jMCg: ? that file is part of the upstart package in Ubuntu.
<SpamapS> jMCg: its in the package
<jMCg> Yeah, I get that, so I'm wondering: Where's the source?
<jMCg> upstart being an Ubuntu project, and the package being from Ubuntu, where does the source come from?
<SpamapS> bzr branch lp:ubuntu/upstart
<jMCg> now I just need to find out how to submit this patch: http://apaste.info/57cf
<SpamapS> jMCg: not sure you can use awk there
<jMCg> SpamapS: I'm pretty sure you can use awk wherever you use cat/grep/cut.
<jMCg> Anyway: On to more important matters:
<SpamapS> true, cut is in /usr as well
<jMCg> if I set a setuid stanza, will pre-start be executed under that user as well?
<SpamapS> jMCg: it was my understanding that upstart just didn't work at all in open-vserver tho
<SpamapS> jMCg: yes, thats the one weakness of setuid/setgid unfortunately
<jMCg> SpamapS: weakness?
<SpamapS> jMCg: we've talked about maybe adding setuid/setgid as options to each executable stanza so you can have pre-start as root and exec as not root
<jMCg> I see. No, in this case it's really fine. If I cannot read $foo as user $bar, then executing the daemon under that user won't be going all that well..
<SpamapS> well often pre-starts will setup a dir in /var/run or something like that
<jMCg> *nod*
<jMCg> one more question: Can I setuid or chdir from an environment?
<jMCg> i.e.: We'd like to configure under which user the daemon is running.
<jmelis> hi guys, I'm an opennebula developer, and I'm trying to create an fpm package that prepares the network (basically writes /etc/network/interfaces). The tricky part is that it needs to be done *before* the init/networking.conf kicks in... does anybody know how can I do that??
#upstart 2013-11-11
<pmatulis> can one say "start on started job1 or job2" ?
<xnox> pmatulis: yes, it's "start on (started job1 or started job)"
<xnox> pmatulis: but read the cook book about caveats w.r.t. or/and events.
#upstart 2013-11-12
<pmatulis> xnox: ty
<d498902_> any ideas here? https://gist.github.com/jeremyjbowers/4416665#comment-948473 complete newb here
<d498902_> hrm, worked with sudo .. I didn't expect to have to use sudo
<hidgw> If I install a new version of a software package that was originally installed with apt-get, using make install, could that break an Upstart job?
<hidgw> I updated from ZNC 1.0 (using backports) to ZNC 1.2 (by compiling and make install'ing from github) and suddenly the Upstart job stopped working
<hidgw> The error I get is: $ sudo service znc start
<hidgw> start: Job failed to start
<hidgw> not especially helpful, since it doesn't tell me why
<hidgw> it also doesn't appear to be sending any errors to /var/log/upstart/znc.log as that file no longer exists (it got logrotated out, I guess)
#upstart 2013-11-14
<jamescarr> correct me if I am wrong, but shouldn't the pre-start script session run and complete  before anything else?
<xnox> jamescarr: well it completes before main process starts (exec or script) of a given job.
<xnox> jamescarr: other jobs can be running at the same time. E.g. all jobs which have star on conditions satisfied.
<jamescarr> cool. 
<jamescarr> I think what happens is my pre-script takes too long so it bails
<xnox> jamescarr: it's executed with "set -e" so if anything exits non 0, then starting the job is aborted.
<jamescarr> kill timeout 20
<jamescarr> tryin that
<jamescarr> I set it, but it seems to be ignoring it
<jamescarr> does it need to be set within pre-script too?
<jamescarr> DAMN
<jamescarr> silly typo in exec command. Couldn't see it because the output from the pre-script overwrote the console
* jodh changed the topic of #upstart to: Upstart 1.11 | http://upstart.ubuntu.com/cookbook/ | Post to mailing list if no response here: http://bit.ly/ooeNVv
<jamescarr> okay I am at my wits end here
<jodh> jamescarr: ?
#upstart 2013-11-15
<adrien_oww> hi, is there a tool that can give me a pretty graph of when a service starts, stops, ... ?
<adrien_oww> I'm doing boot-speed optimization on a fairly big system and bootchart shows I have two big bottlenecks which are almost certainly due to service delays (like "sleep 30"...)
<adrien_oww> but I can't tell which ones
<adrien_oww> otherwise I'll write my own :) 
<jodh> adrien_oww: not currently - the best option atm is to create a job that calls 'upstart-monitor --no-gui' as that will log all events (including job starts/stops) along with high-res timestamps. Then just munge the output using gnuplot/blah.
<jodh> adrien_oww: you could just write your own script though since upstart-monitor is simply listening for the EventEmitted D-Bus signals.
<adrien_oww> ok, thanks :) 
<joelteon> "start mysql" is producing no output for me and exiting 0. it also doesn't start mysql
<Curly060> Hi! I am using upstart to run nginx as webserver. This works fine until I want to use nginx's possibility to update the binary on the fly. This is done by sending a signal to nginx. In that case nginx spawns a 2nd process and phases out the old one. It also updates the PID file. However, upstart is now confused after this. status shows, that nginx stll runs, but it shows no pid. stop says, the job was stopped, but nginx still ru
<Curly060> ns. start claims everyting is ok, except it shows no pid. reload says "unknown instance".
<Curly060> using the old start-stop-daemon functionality the whole procedure is not a problem. But my guess is that upstart works entirely different, monitoring the provess directly and the above procedure "steals" the process which upstart monitors. maybe upstart even tries to relaunch the process, but fails, because nginx is running still.
<Curly060> So is there any way to use upstart and the described change-binary-on-the-fly method with upstart?
<tty-1> hi
<tty-1> anyone online? :)
#upstart 2013-11-17
<xnox> libnih ported to kFreeBSD/eglibc https://plus.google.com/109160032876474505377/posts/Y7VAVVrSDtQ
<ion> cool
#upstart 2014-11-10
<kierank> any idea why start on started foo and started bar doesn't work?
#upstart 2014-11-14
<cwillu_at_work> when did upstart start doing it's own permission checks in addition to dbus?
<cwillu_at_work> I used to have a dbus rule to permit a specific user to start a job, but that doesn't work anymore
<cwillu_at_work> "start: You do not have permission to modify job:  xxx"
<cwillu_at_work> as opposed to "start: Rejected send message, 1 matches rules; type =..." that you get if dbus didn't permit the message send
<cwillu_at_work> more importantly I guess, how do I turn it off?
<jmacdonald> hello
<james_woods> (I googled for about 20 minutes without luck) I need to set my $PATH variable so that upstart can execute the right binary, but it keeps ignoring it. Any idea why? https://gist.github.com/james-woods/f5207bcc1ac5b81f69f6
<jodh_> james_woods: http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in, http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job, http://upstart.ubuntu.com/cookbook/#determining-why-your-service-fails-to-start. At a guess I'd say it might be because you have not set $HOME. Why ipython rather than python? Also, you may be able to remove that sudo call and use the
<jodh_> setuid stanza: http://upstart.ubuntu.com/cookbook/#setuid
<james_woods> jodh_: thanks
<james_woods> :)
<niram> hi, i am trying to setup socket activation for php-fpm
<niram> but it doesn't seem to work
<niram> i have added: start on socket PROTO=unix PATH=/var/path/to/socket
<niram> and: env FPM_SOCKETS=/var/path/to/socket
<niram> i am getting strange behavior.. sometimes the daemon starts right away
<niram> other times it doesn't start at all
<niram> never actually starts when the socket is accessed
#upstart 2014-11-15
<niram> socket activation does not seem to work
<niram> when using unix domain sockets
<niram> but it works when using inet sockets
<niram> any idea?
<niram> i am using ubuntu trusty, it comes with upstart 1.12.1
<Marqin> upstart is not goig to be maintained after 14.04 eol? are there any promising forks?
#upstart 2015-11-09
<CrazyTux[m]> Hey guys -- it seems whenever I install OpenSSH_7.1p1 over the normal ubuntu 14.04 LTS packaged SSHD upstart fails and hangs.
<CrazyTux[m]> Any thoughts/ideas?
<McErroneous> "Upstart provides the same facilities as the traditional "init" system, but surpasses it in many ways. " In my view it makes things more complicated to end-users , like myself... . i am struggeling with upstart.
#upstart 2015-11-12
<ktosiek> Hi! How can I restrict the amount of memory a job can use on upstart 1.12?
<belak> Is there a way with upstart to have an env file, similar to systemd's EnvironmentFile directive?
#upstart 2015-11-13
<canci> I am trying to make a script that delays the shutdown until a specific task has completed.
<canci> My current approach (to test this) looks like this: https://gist.github.com/anonymous/36ac46f826bf3eadf8b5
<canci> However, shutdown/reboot will proceed roughly when the counter reaches 15. Any idea how to fix this?
<belak> Is there a better way to do this? http://pastie.org/10555257
#upstart 2015-11-15
<nebg> hello everyone, which is the equivalent of "systemd-analyze" and "systemd-analyze blame" for upstart ?
<JanC> nebg: use bootchart ?
<nebg> ok thanks
<nebg> does upstart have some advantages over systemd ?
#upstart 2016-11-18
<Ruzzy> yo
<AnrDaemon> Ruzzy: Answering your question in #nginx, strictly speaking, "server_name _;" is an invalid construction.
<Ruzzy> AnrDaemon: oh. that explains that then.
<Ruzzy> what should I use in its place?
<AnrDaemon> Details are in the nginx docs and are rather explicit on that subject.
<AnrDaemon> Nothing. server_name has no effect on choosing what server {} block will be the default.
<AnrDaemon> listen does that.
<Ruzzy> AnrDaemon: oh.
<Ruzzy> alright then
<sarkis> hey all
#upstart 2016-11-19
<krkhan> I have an upstart init (RHEL 6.8) running from /oldroot/sbin/init
<krkhan> [root@RHEL68Test1VM ~]# lsof | grep /oldroot init         1 root  txt       REG                8,2   150352  392509 /oldroot/sbin/init
<krkhan> It is now the only process left with a handle to /oldroot
<krkhan> # fuser -vm /oldroot
<krkhan> However, telinit u does not make it restart
<krkhan> [root@RHEL68Test1VM ~]# /sbin/telinit u
<krkhan> [root@RHEL68Test1VM ~]# fuser -vm /oldroot
<krkhan>                      USER        PID ACCESS COMMAND
<krkhan> strace output: https://gist.github.com/krkhan/6b4e0c1c530268b525be3bacec7f922c
<krkhan> Any ideas on why init isn't restarting properly?
#upstart 2017-11-13
<frew> j/20
<frew> woops
