/srv/irclogs.ubuntu.com/2012/07/05/#upstart.txt

axisysI am on upstart 0.6.5 .. so I guess just comment out start on line would be my only choice?00:03
axisysi am on lucid lts00:03
SpamapSaxisys: yes thats the option you have on lucid15:56
axisysSpamapS: thanks16:20
pmjdebru1jnhi again16:54
pmjdebru1jnI'm using/contributing to UCK (Ubuntu Construction Kit)16:55
pmjdebru1jnwhich allows one to remaster Live CD ISOs by rebuilding the squashfs16:55
pmjdebru1jnmost of it works fine16:55
pmjdebru1jnas far as I can tell it surpresses the starting of services mv /bin/initctl /bin/initctl.blocked; ln -s /bin/true /bin/initctl16:55
pmjdebru1jnhowever when the upstart packages gets upgraded that link is replaced with an original binary again, and services can be started again16:56
pmjdebru1jnthere here a more robust way to inhibit upstart from starting services?16:56
pmjdebru1jnlike policy-rc.d ?16:56
JanCpmjdebru1jn: about your question about an upstart config file yesterday: I don't think there is one17:17
JanCbut on a "normal" Ubuntu system with GRUB you can add it to /etc/default/grub17:18
JanCI'm not 100% that works without an initrd though17:20
JanCwell, I guess it could work (I suppose it works as long as update-grub is run on kernel upgrades?)17:21
JanCand if you want to inhibit certain services from starting, just add a servicename.override which doesn't have a "start on" line in /etc/init/17:24
JanCstarting nothing sounds like a very weird thing to me  ☺17:27
pmjdebru1jnJanC: I already used --no-log passed via pxelinux17:27
pmjdebru1jnJanC: well, chroot environments17:28
pmjdebru1jnit's fairly common17:28
pmjdebru1jnthe problem with the .override file is that I can't predict which services need blocking17:29
pmjdebru1jnthe debian policy-rc.d allows everything to be blocked17:29
pmjdebru1jnwhich is ideal for this use-case17:29
pmjdebru1jnthe lame solution would be to just hold upstart, and to never upgrade it when remastering the cd17:29
pmjdebru1jnbut that would be a shame17:29
JanCdo you actually need upstart to be installed then?17:29
pmjdebru1jn"installed"?17:30
pmjdebru1jnupgraded17:30
pmjdebru1jnupstart is already on the live cd17:30
JanCif it isn't installed, you never upgrade it...17:30
pmjdebru1jnhuh?17:30
JanCand you can remove it, of course17:30
pmjdebru1jnit's the desktop cd17:30
pmjdebru1jnremoving upstart will criple it17:30
JanCwell, I'm not sure what you try to do17:30
pmjdebru1jnas in ubuntu-12.04-desktop-amd64.iso  17:31
pmjdebru1jnmodifying the ubuntu live cd17:31
pmjdebru1jnuck, unpack the squashfs, chroot's to it, allows you to modify stuff, and then repacks it17:31
pmjdebru1jnnifty stuff17:31
JanCah, so you need to disable upstart while doing the changes in the chroot?17:32
JanCscripted chengexs17:32
JanCchanges17:32
pmjdebru1jnright17:32
pmjdebru1jnbut the disabling of upstart needs to be able to survive upstart package upgrades17:32
pmjdebru1jnuck alreayd disables starting of services by diverting /sbin/initctl17:33
pmjdebru1jnbut that fails when upstart is upgraded17:33
JanCbecause changes might include upgrades...17:33
pmjdebru1jnincluding updates into the ISO is a huge boon17:33
pmjdebru1jnespecially a few month's after release17:33
JanChm, does initctl actually look at the upstart config files in the chroot?17:35
JanCI would assume upstart is running outside it17:36
pmjdebru1jnsure17:36
pmjdebru1jnbut divering initclt means dpkg just executes /bin/true instead of calling upstart17:37
pmjdebru1jnthus the service doesn't get started, without any further errors17:37
pmjdebru1jnuntil the upstart package itself is upgraded17:37
pmjdebru1jnit's possibly to deal with this situation manually17:38
JanCI'm starting to understand the problem, I think...17:38
pmjdebru1jnbut I'm looking for a structural solution, so people using uck aren't hit by this issue17:38
pmjdebru1jnthere are also upgrade problems with grub17:38
pmjdebru1jnbut I just added some code, to hold those packages, so they aren't upgraded accidentally17:38
pmjdebru1jnso if nothing else works, I guess I could do that too for upstart,17:39
JanCI wonder if a fake upstart dbus service inside the chroot is possible...   ;)17:39
pmjdebru1jnheh17:39
pmjdebru1jnthat's nasty17:39
JanCjust fake you are upstart (inside the Chroot)17:39
JanCand do nothing17:39
pmjdebru1jnyeah17:39
pmjdebru1jnI was hoping upstart had a standard feature for this17:40
pmjdebru1jnas it's not that uncommon17:40
pmjdebru1jnI wonder how they do this when generating the live cd's from scratch17:40
pmjdebru1jnsimilar issues must occur17:40
* pmjdebru1jn wonders if systemd also discounts lots of use-cases like upstart :(17:40
pmjdebru1jnI used to like to idea of replacing SysV init... not so much anymore17:41
pmjdebru1jnhttps://help.ubuntu.com/community/LiveCDCustomizationFromScratch/17:42
pmjdebru1jndpkg-divert --local --rename --add /sbin/initctl17:42
pmjdebru1jnat least there they use a dpkg-divert17:42
pmjdebru1jninstead of just mv / ln17:42
JanCthat's more likely to persist indeed17:43
pmjdebru1jnright17:43
pmjdebru1jnbut then I wonder where to initctl binary in the newer packages is placed17:44
pmjdebru1jnhttps://bugs.launchpad.net/ubuntu/+source/upstart/+bug/43022417:45
pmjdebru1jnit's marked won't fix17:45
* pmjdebru1jn sighs17:46
pmjdebru1jnoh wait17:46
pmjdebru1jngot re-opened17:46
pmjdebru1jnChroot support is now available in Upstart 1.3.17:49
pmjdebru1jnhmmm17:49
pmjdebru1jnhttps://wiki.ubuntu.com/NattyNarwhal/TechnicalOverviewUpstart17:50
pmjdebru1jnok17:51
pmjdebru1jnso this behavior was actually _added_ to support vserver/lxc etc17:51
pmjdebru1jnand can be disabled system-wide17:51
pmjdebru1jnwhich means fiddling with kernel options17:51
pmjdebru1jn:(17:51
pmjdebru1jnanyhow17:58
SpamapSpmjdebru1jn: AFAIK, the upstart chroot support has nothing to do with vserver/lxc17:58
SpamapSpmjdebru1jn: since neither of those use pure "chroots"17:58
pmjdebru1jnok17:58
pmjdebru1jnthen I'm not sure why that's built into upstart17:58
SpamapSthey both namespace the kernel17:59
SpamapSpmjdebru1jn: for actual chroots17:59
pmjdebru1jnas without vserver/lxc you usually don't want stuff to actually RUN in a chroot17:59
SpamapSpmjdebru1jn: it comes in handy for testing17:59
pmjdebru1jnheh17:59
pmjdebru1jnpossibly18:00
pmjdebru1jnit's a PITA as it seems it can't be disabled _easily_18:00
pmjdebru1jnbut dpkg-divert will probably work well enough18:00
jMCgHello happy people o/~18:12
jMCgI have upstart 1.5 running and a job which is in the state of: logstash stop/killed, process 1850618:12
jMCgThe job itself was killed, I was so clever as to pkill it, so that upstart would restart it, and I would have it reload the config.18:13
jMCgMy being clever wasn't all that clever at all. Now I'm stuck in this state.18:13
jMCg.18:18
JanCstarting the job doesn't work?18:20
jMCgJanC: nope, hangs the same as stop logstash18:23
jMCghttp://dpaste.com/767785/18:24
jMCgOf course this tracks the 'su', but even so, it should've respawned the friggin job, because it's *all* gone.18:24
JanChm, I seem to remember start-stop-daemon is currently the officially recommended way instead of su18:27
jMCgoh crap. There's setuid/setgid now?!18:27
jMCgIn 1.5, that is..18:27
JanCthat too18:27
jMCgSo, on Ubuntu 10.04 I should use start-stop-daemon, and on 12.04 I should use setuid/setgid then.18:29
JanCyou can use s-s-d on both, I suppose18:29
jMCgYeah, but I'd rather not :P18:31
jMCgWell, that still doesn't quite help me with the start/stop that doesn't start/stop :-/18:32
jMCg/proc/self/fd/9: 2: /proc/self/fd/9: setuid: not found18:42
SpamapSjMCg: if you have a process listed that isn't running, you set 'expect fork' incorrectly18:53
jMCgSpamapS: yeah, and how do I fix it, other than rebooting the machine?18:54
SpamapSjMCg: loop fork/wait until the process comes up, then wait for upstart to see it and let go18:55
SpamapSjMCg: there's a ruby and a python version of that out there18:55
jMCgO_o18:55
SpamapSI'm surprised we haven't fixed that with an 'initctl forget-pid job-name'18:55
SpamapSjodh: ^^18:55
jMCgThere's a forget-pid?!18:56
jMCgOh. No there isn't.18:56
SpamapShttp://paste.ubuntu.com/1076921/18:56
SpamapSjMCg: there *SHOULD* be a forget-pid18:56
SpamapSor even better, we should stop abusing ptrace. :)18:56
jMCgSpamapS: yes18:57
jMCgOh how I yearn for Solaris' simplicity..18:57
jMCgDid I just seriously say Solaris' simplicity?!18:57
SpamapShahahahhaaha18:57
SpamapSjMCg: I tend to recommend that people just avoid 'expect fork' or 'expect daemon'18:57
jMCgAnyway, solaris has a process-contract by default, so you follow that and don't care about the forks or how many there are.18:57
jMCgSpamapS: *nod*18:58
SpamapSuse a post-start to determine when the job is ready18:58
SpamapSsince fork() is actually also rarely the time when things are ready.. just closer to it than exec()18:58
jMCgSo, first: Does that thing work with python != 3?18:58
SpamapSjMCg: probably18:59
SpamapSjMCg: I wrote it as python3 as part of my "getting used to python 3" experiment :)18:59
jMCgSpamapS: how often/long will it have to run?19:02
SpamapSjMCg: just run it once.19:04
SpamapSjMCg: it will loop through the whole pid space until it finds the necessary pid19:04
jMCgSpamapS: okay. That fixed it. Now on to the next issue:19:04
jMCg/proc/self/fd/9: 3: /proc/self/fd/9: setuid: not found19:05
SpamapSjMCg: thats weird19:05
jMCgWhen I set setuid logstash/setguid adm19:05
jMCghttp://dpaste.com/767807/19:05
jMCgThat's the whole deal.19:05
SpamapSahh wrong place19:07
SpamapSjMCg: they're root stanzas, not in the shell19:08
SpamapS        exec java -jar logstash.jar agent -f logstash.conf --log logstash-indexer.out -- web --log logstash-web.out --backend elasticsearch://localhost/19:08
SpamapS        emit logstash-indexer_running19:08
SpamapSjMCg: also on that, exec never returns19:08
SpamapSso emit will never happen19:08
SpamapSand I don't believe it is a sub-command in the path, so 'initctl emit'19:08
SpamapSjMCg: further, you don't need that emit.. 'started logstash' is the same event19:08
jMCgSpamapS: yeah, but that's not so much the issue as the setuid stuff ;)19:09
jMCgah19:10
jMCgroot stanzas, now I see19:10
jMCgSpamapS: but the chdir is not?19:10
SpamapSjMCg: chdir is also a root stanza19:11
SpamapSjMCg: tho it also exists in shell, which is why thats working.19:11
SpamapSjMCg: I'd put it at the root tho, much cleaner19:11
SpamapS[ -f ./logstash.rc ] && . ./logstash.rc 19:11
SpamapSjMCg: you can also elimiate that and just use env statements at the root19:11
SpamapSunless there's some important reason that it might be there instead19:12
jMCgSpamapS: nope. There is not.19:19
thinkingpotatois it possible some services cannot be controlled using Upstart? I have a case I can't get working, checked everything I possibly could (based on cookbook, forums, blogs, stackoverflow etc.)19:35
jMCgSpamapS: but env cannot be a file.19:48
SpamapSjMCg: right, thats the point, so if you need it in a file, leave it as-is.. but if you can store it all in one .conf file with env X=y statements, do that.19:54
SpamapSthinkingpotato: no, upstart can "control" any service. What is possible is that the pid of the daemon may have to be tracked using pidfiles rather than upstart's methods (making respawn challenging)19:54
thinkingpotatoSpamapS: thanks for the answer, so approach such as http://askubuntu.com/a/4413 could give me some results?19:58
jMCgSpamapS: where's the init(5)'s source?20:21
jMCgfound.20:21
thinkingpotatook, I tried setting manual start - apparently it depends on some other services, because I'm able to start it from console, good thinking?20:26
=== alienth is now known as itsthecops
=== itsthecops is now known as alienth
pmjdebru1jnJanC: btw just tested, dpkg-divert practically solved my problem21:03
thinkingpotato10 hours later: that was a wrong uid/gid I started with... problem solved, works like charm21:56

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