#upstart 2006-12-26
<ced_> hey
<ced_> merry xmas
<AlexExtreme> hey
<ced_> anyone can give me a hand with my upstart script?
<ced_> i'm trying to get my internet connection to start on boot
<ced_> manually, i only have to type /usr/sbin/pppoe-start to start it
<ced_> so, i wrote a small script:
<ced_> start on started networking
<ced_> exec /usr/sbin/pppoe-star
<ced_> but i think my first line is wrong
<AlexExtreme> yes
<AlexExtreme> edgy isn't upstart-ized yet, there is no networking event
<ced_> oh
<AlexExtreme> start on stopped rc2 would be better i think
<ced_> ok
<AlexExtreme> gotta go, lunch
<ced_> ok, thx
<ced_> i will try that
#upstart 2006-12-29
<Gekkko> boo.
#upstart 2007-12-27
<xoqa> hello... i was looking for the /etc/inittab file in ubuntu when someone pointed out that my distro was using upstart... how would i go about editing what starts during boot?
<xoqa> i'm wanting to replace getty
<savetheWorld> Good morning.  the design plan at  https://wiki.ubuntu.com/ReplacementInitDiscussion  for upstart calls for "Plan: This plan allows for the new system to be implemented without requiring any changes to other packages until they wish to take advantage of the new features."  But it seems the /etc/inittab file has been removed.  What takes the place of that file? 
<ion_> /etc/event.d
<xoqa> thanks ion
#upstart 2008-12-23
<sadmac> python's featureset just doesn't have the kind of combinatorics/discrete math power that ruby does.
<sadmac> builtin sets don't have cross product? really?!
 * sadmac vaguely remembers having to implement that himself for ruby < 1.9
<sadmac> ok, fine, I demand weird things of languages :D
<sadmac> Keybuk: if you're around, just sent you an email
<sadmac2> ion_: have you seen the new state machine prototype?
<ion_> Nope
<sadmac2> ion_: http://screwyouenterpriseedition.blogspot.com/2008/12/new-upstart-state-machine-explained-in.html
<ion_> Alright
#upstart 2009-12-21
<creature> How can I find out the order in which upstart processes are run? Is there a tool that will draw me a tree or print me a summary? 
<Keybuk> there is no such thing as an "order"
<Keybuk> it's an event-driven system
<Keybuk> that means the boot can be different every time
<creature> Well, there's a dependency tree, right? Even if you can't give a deterministic order, you should be able to show various 'levels'. 
<Keybuk> no, there's no "dependency tree", it's an event based system
<creature> (A, B, C) first, then D (due to dependency on B), then (E, F) (which require C, D) to be started, etc...
<Keybuk> Upstart is an event-based system
<creature> Apparently I understand this even less than I thought. So what happens when I boot my system? How do services get started? 
<Keybuk> it does not do dependencies
<wasabi_> creature, events are raised. services are defined as starting on those events, or stopping on others.
<wasabi_> jobs starting emit their own events.
<creature> OK. Well, let me ask another question, which might seem a little off-topic. http://pastebin.com/m1c51bf9c contains the details; in summary, I'm having trouble getting my encrypted disks to start without user intervention at boot. 
<creature> The best that I can determine is that this is some weird interaction between cryptsetup, udev, and upstart. 
<creature> But I have no idea how to debug this. 
<creature> My current hypothesis is that udev (or dbus) is trying to do something, and because there's no /tmp yet there's no dbus-socket, which is causing it. But I don't know how to test this, or alter my boot 'order' (or event triggers) to see if that helps. 
<wasabi_> i don't think dbus is required for any of that, is it?
<wasabi_> dbus shouldn't start until tmp is mounted.
<creature> I don't know how to find out at what point dbus attempts to start.  I wouldn't be surprised if Ubuntu presumes that /tmp is available as soon as / is. 
<wasabi_> Okay, I'm going blind with the cryptoloop stuff, because I've never used it.
<wasabi_> I'm assuming it has some initrd components that should do the work.
<creature> This isn't cryptoloop, it's dm-crypt. And I think it's working via upstart too. There's a cryptdisks-enable.conf in /etc/init, at least. 
<wasabi_> Actually, this is post initramfs isn't it
<creature> Yes, it is, AFAIK. 
<creature> The key things to know are: there's a tool called cryptsetup that does the hard work. Neither of these partitions should require user input. cryptsetup handles the encryption, and makes a /dev/mapper device available, which is then mounted as usual through the fstab. (There's an /etc/crypttab for the crytpo setup.) 
<Keybuk> yeah
<Keybuk> cryptsetup in Ubuntu is busted
<creature> The crypttab says "Partition /dev/sdaX should be used as swap," which doesn't require a filesystem, so it's essentially transparent redirection. System writes to swap device, dm-crypt handles encrypting/decrypting the data that's written to disk. 
<creature> For tmp it's pretty much the same, but it says "This is a tmp filesystem", so it creates a new ext2 filesystem on it at boot. 
<magcius> Keybuk, ping.
<Keybuk> magcius: what's up?
<magcius> Keybuk, creature's having some issues with Upstart and encrypted disks.
<Keybuk> don't care
<Keybuk> cryptsetup is busted in Upstart
<Keybuk> err
<Keybuk> in Ubuntu
<magcius> Is that a known bug?
<Keybuk> yes
<creature> I did try and tell magcius that you were aware of this, but... well. He's an eager beaver. 
<Keybuk> and nothing to do with me
<magcius> Keybuk, okay.
<creature> I'd be interested in seeing a link to "known busted", as I've not come across anything saying that so far. 
<magcius> Keybuk, so it's the rules?
<Keybuk> "the rules" ?
<Keybuk> as far as I know, cryptsetup is a piece of crap that nobody should ever expect to work :p
<Keybuk> I looked at it, I barfed
<magcius> Yes. It's OpenBSD code IIRC
<Keybuk> as far as I'm concerned, if I ever have to care about it, I shall solve it by removing it from the archive
<magcius> so what do you recommend for encrypted disks?
<Keybuk> I don't recommend encrypted disks
<Keybuk> I think it's silly
<creature> So. I don't want dbus to start until my encrypted disks are started. How do I express this in upstart? 
<Keybuk> dbus already won't be started until local filesystems are mounted
<Keybuk> which will include your encrypted disks if they're listed in /etc/fstab as mounted on particular mount points
<Md> what is the ubuntu-approved solution for secure storage then?
<Keybuk> Md: this isn't an Ubuntu channel
<Keybuk> that question isn't appropriate here
<Keybuk> ask people in #ubuntu-devel
<Md> what is the Keybuk-approved solution for secure storage then? :-)
<Keybuk> Md: Don't Do That Then
<creature> OK, well, 'status dbus' shows me that its status is 'stop/waiting'. So much for my dbus-wants-/tmp-but-doesn't-have-it-yet theory. 
<Keybuk> depends whats in your fstab
<Keybuk> is /tmp in your fstab?
<creature> It is. 
<creature> /dev/mapper/ctmp    /tmp/    ext4    defaults,bootwait    0    0
<Keybuk> then mountall will wait for it
<Keybuk> you don't need the bootwait technically
<creature> It should be ext2, but as the hang is on swap creation I don't think that's the problem. 
<creature> Oh, wait, I've got a new theory. 
<creature> I'm going to test this, but if I'm right you'll love it. 
<creature> Fuck yes. I am right. That took some thinking. 
<creature> The problem: cswap and ctmp have random keys, because you never need to decrypt them, right? They had /dev/random as their keyfile. 
<creature> /dev/random is high-quality randomness. It blocks if sufficient entropy is missing. 
<creature> The solution: replace /dev/random with /dev/urandom. 
<Keybuk> so you were starving your entropy pool?
<creature> It was just after boot. There wasn't much entropy by that point. 
<creature> The keyboard-slapping was giving it enough entropy to unblock. 
<MattCampbell> What distinguishes upstart from runit?
<MattCampbell> I'm trying to choose between the two for an appliance project in which fast booting is highly desirable.
<magcius> I've never heard of runit.
<MattCampbell> It's another sysvinit replacement with service supervision.
<MattCampbell> http://smarden.org/runit
<magcius> MattCampbell, what's the advantage of runit over sysv?
<ion> As long as it doesnât run as pid 1, it canât reap parentless child processes.
<MattCampbell> magcius: Services are restarted if they crash.  Each service gets a consistent, clean process state (environment, open files, etc.).  Services are started in parallel.
<Keybuk> how does runit help eliminate race conditions during boot?
<Keybuk> if everything is started in parallel, how do you wait to start things until they *can* be started?
<MattCampbell> it has service dependencies, and there's a sequential initialization stage (a single shell script) before services are started in parallel.
<MattCampbell> My guess was that upstart's developers knew about runit and had some reason for developing upstart anyway.
<Keybuk> how does a job depend on the existance of a device?
<MattCampbell> oh, good question
<MattCampbell> upstart supports that?
<Keybuk> that's the entire point of upstart's existence
<MattCampbell> Oh, I thought the point of upstart was to start services in parallel for faster boot, and restart services if they crash, like runit.  But that was just my assumption.  And the upstart home page said nothing about devices.
<Keybuk> it's all about "events"
<MattCampbell> Perhaps I misunderstood in part because I observed how fast Ubuntu 9.10 and Chromium OS can boot, and thought that was what upstart was all about.
<Keybuk> partly
<Keybuk> if you have an event-based system
<Keybuk> you can eliminate race conditions
<Keybuk> you can eliminate the need for busy loops
<Keybuk> you can eliminate the need for sleeps
<Keybuk> and you can start everything in parallel
<Keybuk> and bits carry on when they can
<Keybuk> so you end up faster as a result
<MattCampbell> Thanks for the clarification.
<MattCampbell> I haven't yet chosen a base distro for my current project (a server appliance, with some unusual requirements), but I wanted to decide on an init system first.  I'll definitely use upstart.  Thanks for being patient with a newcomer.
#upstart 2009-12-22
<wuzle> Hello, I am trying to write a conf file for wicd. It looks like the daemon start, but upstart is tracking the wrong pid. ie if I run 'sudo start wicd', it returns the process as 2806. But soon after, status shows the process as 'stop/waiting' and the pid reported in /var/run/wicd/wicd.pid is 2807. Is upstart tracking the wrong process here? Is there a way to fix it?
<sadmac> wuzle: could be a weird one. strace it and see how many times it forks
<wuzle> sadmac: I tried just starting wicd in the foreground from upstart. It seams to work, but is this a bad thing?
<sadmac> wuzle: you mean you told it not to daemonize?
<sadmac> wuzle: that's a fantastic thing. Always the preferred option
<sadmac> well, you don't get the "readiness" indicator that forking provides, but usually its a fine thing.
<wuzle> sadmac: yes, there was a command line option to wicd.
<wuzle> sadmac: I mean, yes, I told it not to deamonize
<sadmac> wuzle: yeah, that's fine
<ion> As soon as Upstart 0.10 is released, letting it fork is a good thing. Until that, itâs often best to let it stay in foreground.
<wuzle> BTW, this all started because the wicd init.d script wasn't working on startup (Ubuntu 9.10). But worked fine if I call '/etc/init.d/wicd start'. The guys on the wicd chat room thought it was because dbus wasn't started yet. And I noticed dbus moved to upstart. So that is why I have come down this road.
<jfanj> I am having a problem with many of my daemons not starting on boot and was wondering if anyone here could help me out?
#upstart 2009-12-23
<CMooney> Hi. Having some trouble with upstart, anacron and sbackup.
<CMooney> However it seems upstart is the problem (unfortunately), with the same symptoms as these guys 
<CMooney> http://ohioloco.ubuntuforums.org/showthread.php?p=8457121
<CMooney> The solution was to get upstart to wait after initialiseing anacron, I hope there is a better way because that seems to be compltely the wrong "upstart" way of doing things.
<CMooney> Here is the output from the syslog http://pastebin.com/m39ca2796
<CMooney> what does the ! mean in "stop on runlevel [!2345]"?
<ion> See glob(7)
#upstart 2009-12-24
<ion> Parsing IP/UDP/NTP packets with Erlang, http://pastebin.com/f59552ce
#upstart 2009-12-27
<slackguru> So, how doesone sift through what is operated by upstart and whatis still operated by common Sys-V scripting?
<slackguru> It seems that if upstart plans to 'replace' the standard System-V scripting, that the /etc/init.d should also be replaced.
<slackguru> Does UBUNTU plan to move further away from the current  standards? We already have a perfectly good System-V init model and the BSD style init model both of which are considered standards? I guess I don'tunderstand what is hoped to be achieved by implementing upstart.
<slackguru> I am reading on upstartnow, and am wishing I could find some documentation on removing it. I am familiar with the System-V and the BSD style init that Slackware and BSD use, but right now, upstart just seems unwanted.
<slackguru> It seems, that because of UPSTART, I have unwanted start-up scripts that  remain after software removal.
<slackguru> It also appears that some of the things that upstart controls do not properly appear as system services.
<slackguru> Because of this, I can not disable certain things fromrunning on start up without figuring out what exactly it is that upstart does. The website is fairly vague and contains very poor examples.
<slackguru> Does Sys-V still run cron and atd or is that controlled by upstart. What about Evolution?
<Md> slackguru: some ubuntu packages already replaced their init scripts with upstart config files
<slackguru> I see that
<slackguru> ln -s to another folder, thus all the confusion
<slackguru> I have been immersed in the upstart.ubuntu.com website and it does not appear clear how to reverse the process. I recently upgraded from 8.04.3 LTS to 9.10 Karmic since they havethe same support ending date and will upgrade to the next LTS when available. When did upstart become a permanent addition?
<Md> reverse what?
<slackguru> It appears that upstart may be the culprit behind some of the problematic things I am experiencing and I would like to remove it until I can readu up on it further, but those packages that have already updated their scripts to upstart will then become problematic.
<slackguru> brb
<Md> ok, you cannot
<Md> and I highly doubt that it's at fault
<Md> anyway, this is a development channel. I recommend you look for help on an users-oriented channel like #ubuntu
<slackguru> That isn't what upstart.ubuntu.com suggests.
<slackguru> And the folks in #ubuntu are for more generalized support... Discussion about upstart (development and otherwise) takes place in #upstart on irc.freenode.net
<slackguru> I need help with upstart, it's proper operation, converting everything to using it or removing it entirely. Are either a possibility?
<raphael___> I guess it would be easier to help if you at least say what sort of problems you are having, in #ubuntu
<Md> no. you cannot remove it nor convert other packages
<raphael___> some init scripts have already been converted to upstart jobs in karmic, and more should follow. Most linux distributions are transitioning as well
<slackguru> Well, I guess I had better learn it then.
<slackguru> Looks like it wasimplemented back in 6.10
<raphael___> yes, but was running in sysv compatibility mode (and still does, except for the base system which has been converted to upstart jobs)
<slackguru> I can see the need for it now, wanting external calls to the kernel at random times for the appearance of new hardware in a hot swap environment is very attractive.
<slackguru> event driven
<JanC> I'm sure removing upstart is an option, if you don't mind configuring your favourite "init" system by hand
<ion> slackguru: âPerfectly good System-V init modelâ? Thatâs a false statement. Sysvrc scripts required to boot a modern system are full of race conditions and ugly hacks such as having the entire boot sequence wait in a busy loop for some random device to appear. Thatâs one of the major reasons for Upstartâs very existence.
<raphael___> "async is the new trend" ;-)
<JanC> I think some dependency loops will require upstart-specific code in applications to get solved though...
<ion> slackguru: http://www.netsplit.com/2006/08/26/upstart-in-universe/ âWhy change it?â
#upstart 2010-12-28
<SpamapS> Keybuk: so it does look like there's a term handler in ubuntu's upstart..
<SpamapS> Keybuk: which just exits init.. I'm looking through the kernel now to see if it somehow handles the re-exec in a weird way
<Keybuk> I thought there was
<Keybuk> but I can't find it in natty's
<Keybuk> I wonder whether bzr has tried to help
<Keybuk> if that's been lost, that's the fix
<Keybuk> restore the term-handler that just dumbly re-execs init
<SpamapS> does the kernel re-exec if init exits?
<ion> It panics
<SpamapS> right... weird I had to kill 1 twice to get a panic
<ashb> (this isn't really the right place to ask but i'm not sure where is) does anyone know anything about how to generate the deb-installer initrd/netboot image for ubuntu?
#upstart 2010-12-30
<marcosroriz> hi guys,
<marcosroriz> I created a job here, how can I activate it?
<ion> start jobname
<marcosroriz> but its not working
<marcosroriz> root@Onix:/etc/init# start tomcat
<marcosroriz> start: Unknown job: tomcat
<ion> YouÂ should find the error message in syslog.
<ion> Upstart probably failed to parse /etc/init/tomcat.conf
<marcosroriz> none error in syslog
<marcosroriz> here is my conf
<marcosroriz> http://paste.ubuntu.com/548690/
<ion> pre-start stop doesnât mean anything. You might want pre-stop script. Also, youâll probably want âexec "$TOMCAT_HOME"/bin/startup.shâ and ditto for shutdown.
<marcosroriz> how do I make a stop/shutdown section?
<marcosroriz> ion, :3
<ion> pre-stop exec "$TOMCAT_HOME"/bin/shutdown.sh
<ion> or
<ion> pre-stop script
<ion>   exec "$TOMCAT_HOME"/bin/shutdown.sh
<ion> end script
<marcosroriz> oh
<marcosroriz> I tried that, but I keep getting stop: Unknown instance: 
<ion> That probably means 0) starting it failed, or 1) startup.sh daemonized and exited, causing Upstart to think it stopped.
<marcosroriz> ohh
<marcosroriz> it's running ok (since I can browse tomcat page)
<marcosroriz> probably option 1
<ion> Upstartâs current fork-following code is still preliminary and a bit tricky to use. It should be easiest just to make it stay in the foreground.
<marcosroriz> :) cool
<marcosroriz> I hope I can help the project too
<marcosroriz> is it on c?
<ion> yes
<marcosroriz> :3
<marcosroriz> I'm not very good on C
<marcosroriz> ='(
<Jordan_U> I am currently having a problem where many processes are becoming defunct even though they are owned by init. Does this suggest a bug in init (upstart in this case)?
<Jordan_U> I'd like to keep this machine running to be able to provide more debug information but it's getting more and more unuseable, and it's my main machine.
#upstart 2010-12-31
<tgies> so i see we still have the problem where upstart will be waiting forever for a fork if an "expect daemon" job bails before forking
<tgies> and that's just great
<tgies> how do I go about clearing out a job stuck on start/killed?
<komitee> anyone try out upstart on rhel6 yet?
<komitee> Is there any way to determine what upstart events are issued during bootup on a given system?
#upstart 2011-01-01
<Stevee> hello, a happy new year @all
<Stevee> i've a question / problem - I've a couple of network services and i want to stop them bevore the network would be stopped
<Stevee> is there any change to do this without a static "stop on stopped service a and stopped service b and stopped service c ...." ?
<Stevee> anyone an idea ?
#upstart 2011-01-02
<steffen_b3> hi 
<steffen_b3> can we really expect all of this: https://wiki.ubuntu.com/FoundationsTeam/Specs/MaverickFinishUpstart beginning of March ? 
<Keybuk> that's the plan
<Keybuk> Canonical has multiple people working on Upstart
<Keybuk> at this point, 1, 2 & 4 are complete
<steffen_b3> ok - cool - that makes it sound feasable 
<Keybuk> 7 is complete, but may be changed as there's discussion going on upstream
<Keybuk> 3, 6, 8, 9 & 10 are all in progress
<Keybuk> so the only one not started is #5
<steffen_b3> #5 is nice but not that important 
<steffen_b3> looking forward to see the rest :) 
<steffen_b3> if working as expected should simplify the jobs we have a lot 
<Keybuk> a little yeah
<Keybuk> 0.6 still has the fundamental issue that the "start on" / "stop on" single stanzas are hard to work with
<steffen_b3> yes
<steffen_b3> and states are missing a lot 
<Keybuk> that's all being worked on though ;-)
<Keybuk> just not for natty
<Keybuk> it may end up being released around the same time though
<Keybuk> so natty+1 can start straight away with a new upstart
<steffen_b3> thats fine
<steffen_b3> i'm working on yavdr 
<steffen_b3> so we are not bound 100% to ubuntu releases
<Keybuk> ah cool
<steffen_b3> at the moment we are using things like 
<steffen_b3> LANG=C /sbin/status openbox | grep -q process && /sbin/initctl emit vdr-frontend-restart || /bin/true
<steffen_b3> or 
<steffen_b3> while [ ! -e /tmp/vdr-xine/stream ] ; do sleep 0.1 ; done
<Keybuk> does respawn not work?
<steffen_b3> which becomes quickly quite nasty
<Keybuk> (for the former)
<steffen_b3> it should start vdr-frontend
<steffen_b3> if vdr restarts
<steffen_b3> but only if X is up
<steffen_b3> else it will respawn it until it gives up
<Keybuk> ah right
<Keybuk> that makes sense
<steffen_b3> by the socket activation we should get rid of the sleeps
<steffen_b3> we have more then one of it 
<Keybuk> yup, and the direct state support will let you better specify the former
<steffen_b3> yes 
<steffen_b3> then being able to start processes as user is another thing 
<steffen_b3> if i got it right it should be also possible around that time 
<steffen_b3> only one problem i didn't found any solution yet 
<steffen_b3> to stop the shutdown process until a service has finished stopping 
<steffen_b3> at runlevel everything start to stop at the same time 
<steffen_b3> including dbus
<steffen_b3> so if you want to delay it 
<steffen_b3> upstart seem to hang 
<steffen_b3> something like 
<steffen_b3> stop on stopping rc 
<steffen_b3> anyway needs a closer look in march then 
<steffen_b3> mainly wanted to see if the agenda is wishfull thinking or really something behind :) - great to see its the second 
<Keybuk> not sure what you mean by the stopping bit?
<Keybuk> I suspect you're talking about an Ubuntu bug there, rather than an Upstart problem?
<steffen_b3> i guess its an ubuntu bug 
<steffen_b3> but i don't really differentiate that much 
<steffen_b3> ;)
<steffen_b3> or i really can't make sure those bug that is
<steffen_b3> if a signal is delayed to after dbus has stopped
<steffen_b3> the signal never happens
<steffen_b3> for upstart 
<Keybuk> oh right
<Keybuk> yeah D-Bus is stopped by the runlevel event, which happens in parallel to the rest of the shutdown
<steffen_b3> and dbus is stopped at runlevel
<steffen_b3> yes
<steffen_b3> so if you try to get in before rc 
<steffen_b3> to delay it until the service is down 
<steffen_b3> rc will never be run
<Keybuk> Clint and James are working on a fix for that involving adding explicit "initctl emit" statements to the sysvinit shutdown
<Keybuk> which will wait for the upstart jobs to stop
<steffen_b3> cool :)
<steffen_b3> vdr needs a couple of seconds to stop 
<steffen_b3> and we try to run fsck at shutdown 
<steffen_b3> at the moment fsck is not run, as the filesystem is busy 
<steffen_b3> so that thing will also be taken care of by natty then i hope/guess ?
<ion> Unrelated, but anyhoo: iâm using this to avoid fscks on startup: https://github.com/ion1/e2croncheck
<Keybuk> steffen_b3: I would imagine so, yes
<steffen_b3> fsck on a mounted filesystem 
<steffen_b3> ah on a lvm volume snapshot 
<Keybuk> yeah, I think fsck is one of those things the Linux world is collectively waiting for btrfs for
<Keybuk> "we could fix it now, but it's hard, and btrfs doesn't need fixing"
<steffen_b3> i use xfs on the big disks 
<steffen_b3> and ext4 on system 
<steffen_b3> thing never seen fsck running 
<steffen_b3> thing = think
<steffen_b3> " XFS is a journaling filesystem and performs recovery at mount(8) time if necessary, so fsck.xfs simply exits with a zero exit status. "
<Keybuk> heh, XFS doesn't perform recovery
<Keybuk> XFS abandons your data on a remote tropical island without so much a bottle of rum
<steffen_b3> :D
<steffen_b3> anyway its a lot but not mission critical data 
<steffen_b3> i would prefer something reliable w/o fsck 
<steffen_b3> but until then xfs works fairly well here since the last 5 years or so 
<Keybuk> well, you always need to fsck
<Keybuk> but filesystems like btrfs support online fsck
<Keybuk> so you don't need to stop everything for it
<Keybuk> you just fsck when you feel a need
<Keybuk> (e.g. it can go in cron)
<steffen_b3> ok let me rephrase 
<steffen_b3> without waiting possibly hours for the FS to do "something"
<steffen_b3> before the machine boots/shuts down 
<Keybuk> indeed
<steffen_b3> not sure if btrfs is mature enough allready 
<Keybuk> it's at least as mature as ext4
<Keybuk> the only reason Ubuntu hasn't switched, at least for netbooks or desktops, is that there's still a licensing issue with the boot loader
<Keybuk> the btrfs code, being kernel, is GPL 2 only
<Keybuk> the boot loader (GRUB 2) is GPL 3+
<steffen_b3> ok - so i should think about switching at next installation 
<steffen_b3> i mean in the end its just hours of TV recordings 
<steffen_b3> for my use case 
<Stevee> hello, i've a question / problem with upstart and a couple a network services - they should stopped bevore the network will shutdown
<Stevee> so is there any change to do this without a static list of the services in the network job - like "stop on stopped service a and stopped service b and stopped service c ...." ?
<steffen_b3> you should stop them on the network signals then
<steffen_b3> not the other way around
<Stevee> so you mean stop this services on "stopping network" ?
<steffen_b3> i'm not sure
<steffen_b3> but i think
<steffen_b3> net-device-down should exist
<Stevee> the whole network is controlled by a python script
<Stevee> so, there is no app for upstart to watch and to stop / wait
<steffen_b3> stop on net-device-down IFACE=*[0123456789]
<steffen_b3> would stop the service on any network device going down 
<steffen_b3> except lo
<Stevee> yes, but the service should stop bevore the network will stop
<Stevee> the only way i image is, to define a kind of static list with every service
<Stevee> and only if all of them are stopped the network service / job will stop
<steffen_b3> hmm
<Stevee> but this list of jobs can change so this is no option
<Stevee> is there any kind of define a group or something ?
<steffen_b3> you mean like create 1 job with your conditions
<steffen_b3> and let the other jobs 
<steffen_b3> start on started
<steffen_b3> stop on stopping 
<steffen_b3> that job 
<steffen_b3> not sure if my thinking is to complex right now 
<steffen_b3> but you could have a job which reacts on net-device-down (or net-device-removed?) which is checking the number of network interfaces up
<steffen_b3> if it reaches 0 or 1 (depending if you want to filter lo or not) 
<steffen_b3> it issues a signal 
<steffen_b3> which can stop the services 
<steffen_b3> not sure if that is enough 
<Stevee> the amount of network interfaces also is dynamically
<steffen_b3> but not the amount of network interfaces where you would want to stop
<steffen_b3> which is 0 
<steffen_b3> allways
<Stevee> that is true
<steffen_b3> net-device-added -> count++
<steffen_b3> net-device-removed -> count--
<steffen_b3> if count == 1 -> initctl --no-wait emit some-signal 
<steffen_b3> stop on some-signal
<Keybuk> you'd want to wait, surely?
<Keybuk> your code would be:
<Keybuk>   initctl emit net-going-down
<Keybuk>   ifdown ...
<Keybuk>   initctl emit net-down
<Keybuk> if you used --no-wait, you'd tear down the network without waiting for the services to stop
<steffen_b3> good point 
<Stevee> oh there is a own event net-going-down ?
<Keybuk> Stevee: there is if you make one
<steffen_b3> :D
<Stevee> yes, clearly, we emits that
<Keybuk> Upstart has no fixed list of events
<Keybuk> it's up to you to emit them when you want them
<Keybuk> and up to you to decide when you emit whether or not you want to wait for Upstart to finish
<Keybuk> an Ubuntu machine, for example, has a "net-device-down" event - but this isn't waited for
<Keybuk> because Ubuntu takes the position that you can't control a network device going down, it could go down because the WiFi is out of range, because the user hit the kill switch, because the user pulled out the network cable or card, etc.
<Keybuk> so since you can't guarantee "service is stopped before network goes down", it doesn't provide that facility
<Keybuk> that's not an Upstart limitation though, just an Ubuntu policy decision
<Stevee> yes, so my point is to kill all network services with an event
<Stevee> and after they all has been stopped, to shut down the network
<Stevee> but my only idea to perfom that is a kind of static list
<Keybuk> nah
<Keybuk> you can just use an event for that:
<Stevee> like "stop on stopped service a and stopped service b and so on"
<Keybuk> in your code just do:
<Keybuk>   initctl emit kill-all-network-services
<Keybuk>   ifconfig ... down
<Keybuk> then the jobs that need to be killed have:
<Keybuk>   stop on kill-all-network-services
<Stevee> yes
<Keybuk> you don't need any kind of static list
<Stevee> if i put this initctl kill-all-network-services into a jobfile
<Stevee> will upstart wait on executing the next command ?
<Keybuk> yes
<Stevee> so at first it emits the event
<Stevee> the services will stop
<Stevee> and than it will shutdown the network ?
<Keybuk> yup
<Stevee> great, thanks
* Keybuk changed the topic of #upstart to: Upstart 0.6.7 "Return of the Mole" | http://upstart.at/
<Stevee> how is the correct syntax: stop on kill-all-network-services or stopped network ?
<Keybuk> the two syntaxes are both correct, depending what you want to do
<Stevee> both
<Keybuk> then that's correct two
<Keybuk> too
<Stevee> thanks
<Keybuk> that'll say stop on the k-a-n-s event OR if the network job gets stopped without emitting that event
<Stevee> yes thats correct
<Stevee> if the network ist stopped manually the net-services also should stop
<Stevee> is it possible to add multiple initctl emit xyz init a script blog of a jobfile ?
<Stevee> init = into
<steffen_b3> bye all :) 
<Stevee> good bye
<Stevee> thanks for the help
<Stevee> to slow :(
<Stevee> Keybuk thanks for your great help
<Keybuk> Stevee: sure, as many as you want
<mbiebl> Keybuk: start on socket ... vs start on dbus-activation ...
<mbiebl> would be nice to either add -activation to socket or drop -activation from dbus
<Keybuk> mbiebl: yeah, they're just drafts at the moment
<Keybuk> going to send the new draft of the dbus patches to the ML in a bit
<Keybuk> been a week since the discussion on the common interface tailed off, so a good time for an RFC + patches to get it going again
<Stevee> gn8 @all - thanks for hel
<Stevee> p
<ion> thanks for hell
<Keybuk> ;-
<Keybuk> ;-)
<Keybuk> mbiebl: right, that's those patches sent
#upstart 2011-12-26
<viric> hello
<viric> I have 'start on started A and started B'
<viric> for job C.
<viric> That works fine at boot, when A and B start.
<viric> But if I restart only A, then C is not restarted. How can I make it restart?
<viric> I wonder if 'start on started A or started B'... but 'C' should start only if both are running
#upstart 2011-12-27
<aoberoi> hey there, i really want the new 'console log' feature in 1.4, and since the latest in the ubuntu repos is 1.3, does that mean i should just compile from source?
<aoberoi> and if so, is there anything i need to know about specific config for ubuntu and/or CentOS?
<aoberoi> well looks like 1.4's console log is broken for me
<_TJ__> if i want to start a job after everything in init.d has been started, what would be the correct approach ? starting my jobs as :  start on stopped rc-sysinit results in the job being started multiple times.... ?
#upstart 2011-12-28
<viric> Helo
<viric> Hello
<viric> Can it be that mountall emits 'filesystem' on shutdown?
<Md> kay: are / and /usr ro or rw when the red hat initramfs gives control to init?
<Md> oops
#upstart 2011-12-31
<astruasdh> please, how can I create an upstart entry like rc.local?
#upstart 2012-12-27
<ajohnstone> Can anyone explain why such a simple upstart fails to write to /tmp/? https://gist.github.com/4387936 
<ajohnstone> Updated gist here... https://gist.github.com/4387977
<ajohnstone> upstart 1.5-0ubuntu7  - if that makes any difference?
<JanC> ajohnstone: I'm not sure why it doesn't write to /tmp/ but your "service" exits immediately and thus will get into a respawn loop?
<ajohnstone> JanC: How can I debug what is going on better?
<ajohnstone> I've noticed on occassion it hanging to stop/start the service... I assume this to be in a respawn loop?
<JanC> that job file makes no sense at all, so I assume what you are really trying to do is something else?
<ajohnstone> Yup, was trying to go back to bare basics to work out what the hell is going on
<JanC> this doesn't look like "bare basics" equivalent to any real world type of job
<JanC> you might want to use a "console log" stanza and not use redirects for you echos
<ajohnstone> When using console log or console output neither seemed to get pipped to syslog.
<ajohnstone> What I'm really trying to run. https://gist.github.com/4388880 The pre-start script never executes.
<JanC> 'console log' logs to a file in /var/log/upstart/
<ajohnstone> Arr, stupid me:P
<JanC> the "start on startup" in there might make it start before /tmp/ is available?
<JanC> you also have 2 "respawn" stanzas and two "stop on" stanzas, only the last one will be used
<JanC> ajohnstone: did you read the cookbook yet?  (see /topic )
<ajohnstone> tbh, skimmed it somewhat
<ajohnstone> Is it possible to capture the status event and execute a script before status?
<JanC> no (there is some talk about that, I think, but currently it doesn't exist)
<ajohnstone> JanC: Thanks for your help so far, much appreciated. Hope you had a good Christmas.
<JanC> hm, looks like there is a graphite-carbon package in Ubuntu
<JanC> which has a sysvinit script that might give you some inspiration
<JanC> (or which you might prefer to use)
<ajohnstone> It doesn't support instances I don't believe, think I looked at it already.
<ajohnstone> Ends up with python being pegged to a single core, so need to balance the traffic.
<SpamapS> ajohnstone: are you sure the pre-start never runs? perhaps /opt/graphite is not a directory?
<SpamapS> ajohnstone: try 'initctl log-priority info'
<ajohnstone> It does exist, I have removed that check previously.
<ajohnstone> On that machine it does not have "/var/log/upstart" btw
<SpamapS> ajohnstone: and really.. console log is what you want.. logging to /var/log/upstart/jobname-instance.log with built in rotation is a nice win :)
<SpamapS> oh
<SpamapS> create that dir
<SpamapS> its part of the upstart pkg IIRC
<ajohnstone> Heh, now I fee silly :) Permission denied: '/opt/graphite/storage/log/carbon-cache/carbon-cache-e/console.log
<ajohnstone> Thanks for both your help :D
<SpamapS> :)
<JanC> hm, seems like Canonical uses graphite too?
<ajohnstone> Its pretty good, at peak was doing 1.2 million stats a second, across haproxy, 3 carbon-cache and 2 relay servers. Very handy when you can change the charts around and contrast different things.
<JanC> not sure what they use it for, but they are listed on the "who is using graphite" page  âº
<JanC> together with some companies that probably have way more stats/charts than them  âº
#upstart 2013-12-23
<linux_dr> great.. thanks
<linux_dr> I think what I was looking for was something like: start on stop rc[2345]
<xnox> linux_dr: =) that would work.
<xnox> linux_dr: you can override starton/stopon conditions for a few jobs as you see fit.
<xnox> linux_dr: do use an override file. E.g. "echo start on stopped rc RUNLEVEL=2 | sudo tee /etc/init/ssh.override"
<xnox> (i didn't test above, but I think that's about the right syntax)
<xnox> linux_dr: the benefit, if there are typpos / mistakes in the override, just the override is rejected and the job will start/run using the base config.
<xnox> linux_dr: and it works transparent for package upgrades
<xnox> linux_dr: any stanzas from the override are preferred over the base job file. See cookbook for further details.
<xnox> or man pages.
#upstart 2013-12-24
<munderwo> Hi all. Im having a bit of an issue setting up gunicorn with upstart and a django app that still uses the old run_gunicorn command?
<munderwo> When I use the following config on ubuntu 12.04 http://dpaste.com/1520593/ when I try to start the server it just hangs.
<munderwo> any ideas?
#upstart 2013-12-26
<kai__370> hi all. When i put "console log" in my  upstart script. Will also be output of processes that have been launched by my service be logged? Thanks!
#upstart 2014-12-22
<stoogenmeyer> hey anybody here?
<stoogenmeyer_> Hi, is there a way to start multiple services with one call to upstart? lets say I've got 2 .conf files in /etc/init/stoogenmeyer and I want to call 'start stoogenmeyer/*'. This doesn't work, any way to do this?
<rk[abc]> i have a seemingly fair question
<rk[abc]> let's imagine that i am setting up a box for someone and i need to create an upstart job for their application
<rk[abc]> assuming that i create the upstart job prior to the application existing on the box
<rk[abc]> will this job create any issues, linking to a binary that doesn't yet exist?
<rk[abc]> ie will it continue over and over to start this application until it exits?
#upstart 2014-12-23
<rk[abc]> causing any performance issues?
<phutchins> Anyone know how to control the user and group of upstart logs?
<phutchins> I.E. I need the group of /var/log/upstart/mylog.log to not be root, or be word readable, even after the file is rotated.
<rk[abc]> phutchins: i think your best bet is to create a cronjob that copies the logs and changes permissions on the copy.
<rk[abc]> or maybe trying an aggregate logger program like logstash
<phutchins> I ended up just logging to file and using logrotate.d where you can specify ownership of the file
<phutchins> doesn't seem that upstarts logging function allows any sort of configuration of permisisons or ownership of the logs that it writes
<shrabok> is there someone that can help with an issue I am having with upstarts respawning?
<shrabok> I have an upstart that runs an ssh tunnel script but it can occasionally fail the first few tries waiting for dns to propagate, but when the script fails the upstart will reach a running state and than respawn
<shrabok> I have another upstart that depends on this upstart running before it starts. But the upstart states its reach running state and then respawns and as a result the dependent upstart runs
#upstart 2014-12-24
<TowerPower> Hi, I'm trying to set up a basic upstart job to launch a tmux session. In pre-start, I'm running 'tmux has-session -t foo' and then testing the exit code. Problem is, when the code is 1 (failed), the script stops. I guess I want to make sure that that's expected behaviour, reading the docs I can't find any reference to a command in a script failing making the whole job fail. Any suggestions to workaround?
<TowerPower> I misspoke on the exit code. Perhaps a more succinct way of putting it is: if pre-start contains the line false (exit code 0), the whole job fails. Is that expected behaviour and is there a way to make the job not fail?
<JanC> TowerPower: upstart runs all scripts with "/bin/sh -e"
<JanC> from the manual: """script ... end script / This stanza defines the process to be run as a shell script that will be executed using sh(1).  The -e shell option is always used, so any command that fails will terminate the script."""
#upstart 2015-12-21
<Trevinho> Hi, is there a way to dry-run upstart (session) to see the order of how things would be executed? So a way to simulate it?
<Trevinho> (assuming that things are running properly)
#upstart 2017-12-26
<lucas_ai> I want to run a simple command to start a proxy server, when my ubuntu server instance starts up or reboots. How can I do this VERY EASILY?
