/srv/irclogs.ubuntu.com/2013/09/25/#upstart.txt

twbHas anybody already written a script that can look at /etc/init and spit out a graphviz (or similar) dependency DAG ?01:16
stgrabertwb: like initctl2dot (which we ship by default with Upstart)?01:29
twbI guess so; I'm still on Ubuntu 10.04 and I hadn't dpkg -L'd anyway01:29
stgraberah, not sure if we already had it back then, but I know it's been around for a while now01:30
twbI'll just pull it from HEAD and see if it works on its own01:30
stgraberif you take the one in trunk, I ported it to python3 which I don't believe we had in 10.04, so I doubt that'll work01:31
stgrabertaking an older revision should be fine though01:31
twbOK01:31
twbhttp://archive.ubuntu.com/ubuntu/pool/main/u/upstart/upstart_1.8-0ubuntu1.dsc should be old enough to be using python2 ?01:32
stgraberthere's a pretty good chance 1.8 already had the python3 rewrite as my branch got merged in November 201201:33
stgraberI'm sure that 1.5 is a safer bet01:34
twbHm, I can't see an initctl2dot in that tarball01:34
stgrabertwb: looked under scripts/ ?01:34
twbI did find -name \*dot01:34
stgraberah, look for dot.py then01:34
twbAh found it01:35
twbI could just run the script on another, newer host01:35
twbba-bow: $ ssh spoon initctl show-config -e --err--> initctl: invalid command: show-config01:36
stgraberah, looks like upstart under 10.04 is a bit old for that command...01:36
stgraberso probably easier to get a 12.04 machine with the same set of jobs and run initctl2dot on that one01:37
twbWhat this is all in aid of, is to work out why squid & an in-house daemon both fail to start sometimes when the server is rebooted01:37
stgrabersounds like a race condition between the network interfaces getting configured and the daemon starting01:38
twbWhich I suspect is because they're trying to bind to an interface that isn't up or resolve a hostname before LDAP or DNS is up or something.01:38
twbLooking at the dependency graph seemed like the best first step :-/01:38
stgraber10.04 wasn't great for that, some stuff were switch to upstart, some were still under sysvinit, so things may be a bit random... I did a fair amount of work in 12.04 to try and get all of that a bit saner (though unfortunately it ended up being way too big to backport to 10.04)01:38
twbCan you pastebin what initctl show-config -e output looks like?  I can probably mangle that by hand with some sed.  I don't have a newer ubuntu system handy01:39
stgraberare squid and your inhouse software using upstart jobs or are they good old sysvinit jobs?01:39
twbupstart01:39
stgraberok, what are their start conditions?01:39
twbsquid is start on runlevel [2345] or net-device-up IFACE!=lo; stop on runlevel [!2345]01:39
twbppcadm is start on runlevel [2345]; stop on runlevel [^2345]01:39
stgraberok, and do those require some special network interfaces to appear? (thinking of bond, bridges, vlan, tunnel devices, ... that kind of stuff)01:40
twbThat first one looks buggy to me, looks to me like it assumes a single-NIC system01:40
twbLemme pastebin the interfaces(5)01:41
stgraberoutput of initctl showconfig -e on 13.10: http://paste.ubuntu.com/6152669/01:41
twbhttp://paste.debian.net/45811/01:41
twbAFAIK we don't have bonding on anything anymore, at least one with no bonding is having startup issues01:42
stgraberok and upstream, staff and prisoner are all aliases for real network interfaces setup through udev?01:43
twbYeah they're renamed from eth0 style names01:43
stgrabermy current guess is that those appear as standard ethX devices which then get renamed by udev, so you get a first net-device-up event with the wrong name before it vanishes to get renamed...01:44
twbAh.01:44
stgrabertwb: you could try to get both jobs to do "start on net-device-up IFACE=prisoner" or whatever interface they actually need01:44
twbSo if I just slap in an "AND net-device-up IFACE=staff AND net-device-up IFACE=prisoner" ?01:45
stgraberyep, that'd work, upstart will just wait until it got all 3 events and then will start the service01:45
twbI don't really care if they don't start for two minutes or whatever after boot -- plan Z is to just add a great big "pre-start exec sleep 300"01:45
stgrabersounds like having upstart wait for the interfaces would be considerably cleaner than a huge sleep in pre-start ;)01:46
twbNo argument there01:46
twbThe problem is that atm after a power outage, upstart tries a few times then gives up, end result is they never actually start and then the inmates riot because they can't get their porn.01:47
twbI'll do some restarts with extra net-device-up01:49
twbHm, syslog says squid is getting an ABRT.02:44
twb(Before I change the start on)02:44
twbAh, the reason squid is crashing is because some fool thought it would be a good idea to make it use a whitelist helper that talks to postgres.  And postgres as at 10.04 is in sysvinit still.04:32
twbFun :-/04:32
twbAnd I'm guessing "start on runlevel [2345]" is when that runlevel *begins*, not when it ends.04:34
twbAnd the ppcadm one is not starting because it needs slapd to be accepting connections before it starts.05:42
twbWhich is also in sysvinit as at 10.0405:43
SwashBucklaAnyone written a rule for when `sudo service <service> restart` is invoked? http://upstart.ubuntu.com/cookbook/#restart12:55
SwashBucklaI'm writing an upstart job to daemonize a script, and am struggling to capture when `restart` is called -- what state is the process in?12:55
SwashBucklais there an upstart condition? It's not pre-start or pre-stop12:55
jodhSwashBuckla: is the problem that your job is not able to restart the daemon script? Have you read http://upstart.ubuntu.com/cookbook/#expect ?13:14
SwashBucklaI can restart it just fine13:21
SwashBucklathat works13:21
SwashBucklabut I want to capture in the daemons .conf file WHEN that happens, do FOo13:21
SwashBucklaFoo*13:21
jodhSwashBuckla: there is no "restart" state - using the restart(8) command, the job is restarted whilst retaining its original config. Is this job a system-level one? If so, if you really want the job itself to know it has restarted, your best bet it probably to log something via a pre-start then check that value in the pre-start so you know how many times you've been restarted.13:32
SwashBucklajodh: hmm. OK.13:35
jodhSwashBuckla: generally jobs shouldn't care if they have been restarted - they just need to handle that scenario13:35
SwashBucklayeah I'll have to leave some breadcrumbs and look for them13:35
SwashBucklaI need to fire off an email in the event that a daemon was restarted, started, or stopped13:36
SwashBucklaas I care about the state of a daemon on a headless server13:36
jodhSwashBuckla: it would be better then to create a new "monitor" job that specifies "start on (started or stopped)" and does whatever you need.13:37
PaulePanterHi. How do I analyze the startup process of my Ubuntu 12.04 server?14:33
PaulePanterIs there an equivalent to `systemd-analyze`?14:33
jodhPaulePanter: not atm. I suggest you apt-get install bootchart: http://www.bootchart.org/15:33
PaulePanterjodh: Thanks. I already tried it, but it is not conclusive yet as a mdraid resync runs in the background.15:40
PaulePanterA little off topic, is there a guide what I can disable on a server (where no graphics is needed for example).15:40
PaulePanterI am on Ubuntu 12.04. How do I easily find out if there are Upstart scripts in later releases for packages not shipping them?15:53
PaulePanterCollectd is installed and does not seem to have one.15:54
PaulePanterMark Brooks published one here http://blog.loadbalancer.org/upstart-script-for-collectd/ and I wonder if Ubuntu already ships one so I can compare them.15:56
jodhPaulePanter: Some of this is indeed rather off-topic (you are probably better off asking some of this on #ubuntu-server in future). However, you can use http://packages.ubuntu.com to query package contents for any ubuntu release. Or use 'apt-file list <pkg>' on a newer version of Ubuntu (you'll need to 'apt-get install apt-file') to see what files a package ships.16:06
PaulePanterjodh: Thanks. (That method is not very user-friendly though. ;-) )16:09
jodhPaulePanter: ?16:10
PaulePanterjodh: Looking at http://packages.ubuntu.com/saucy/amd64/collectd-core/filelist and finding out that there is an upstart file, I would not be able to easily check the content of the file or copy it.16:15
PaulePanterIn the end I would need to download the deb file and extract it, if I am not mistaken.16:15
PaulePanterOr are all package’s source files tracked in Launchpad in Bazaar?16:16
jodhPaulePanter: yes, you can access the files on bzr: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/collectd/saucy/files17:15
PaulePanterjodh: Awesome! Thanks. That method is easy!17:22
PaulePanterThough in this case I could not find the upstart job.17:22
PaulePanterhttp://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/collectd/saucy/files/head:/debian/17:22
glisignoliHello, upstart newbie here. I have a server in single user mode and want to disable the starting of an upstart service for a few restarts, then enable it again.23:42
glisignoli*upstart 0.6.523:44
glisignoli:(23:44

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