Re: s6 talk at FOSDEM 2017: video
On Tue, 07 Feb 2017 16:35:37 + "Laurent Bercot" wrote: > >Thing is, I've always thought of anopa as a set of tools, that allow > >you to set things up however you want. I like that idea, and so > >that's why it doesn't create service(dir)s on its own, unlike > >s6-rc. > > I totally agree with that philosophy, but all the pressure I'm > getting is always in the direction of "make it more user-friendly, > accessible to normal people, integrate it more, more high-level > commands" - never the other way. Sure, I get that; And to be clear I wasn't in any way "criticizing" the magic in s6-rc, just merely explaining why I left it out of anopa. It certainly is a cool thing from a user POV to have s6-rc handle all that as simply/easily as it does. But even though anopa doesn't do this on its own, you're right, I should probaly have it (that "aa-command" longrun) somehow featured in anopa, or make it easy for people to use it without having to figure it out & write it on their own... Still thinking about how I'll do this. Thanks!
Re: s6 talk at FOSDEM 2017: video
Thing is, I've always thought of anopa as a set of tools, that allow you to set things up however you want. I like that idea, and so that's why it doesn't create service(dir)s on its own, unlike s6-rc. I totally agree with that philosophy, but all the pressure I'm getting is always in the direction of "make it more user-friendly, accessible to normal people, integrate it more, more high-level commands" - never the other way. That's why I added magic to s6-rc-compile to make it run a fdholder and a oneshot-runner automatically as needed: users want the resulting mechanism without having to concern themselves with the details, so if the details can be automated, all the better - even if, for you and me, they're easy to understand and set up manually. So if you think an "aa-command" longrun is the proper way to run oneshots with anopa (a position I obviously agree with) I think you should have it by default in your example service sets, or something of the kind. Few people have the inclination and time to tinker enough to come up with that themselves! OTOH anopa does come with aa-stage{0..4} scripts, that's true. You also have some kind of tty management, which s6-rc doesn't. -- Laurent
Re: s6 talk at FOSDEM 2017: video
On Mon, 06 Feb 2017 22:44:07 + "Laurent Bercot" wrote: > I'm obviously partial to s6-rc since it's the one I wrote :) and I'm > especially proud of the fact that it runs oneshots with the same > reproducible launch guarantees that it runs longruns with - something > *no* other service manager does (except integrated init systems since > those get everything started by pid 1 anyway). Yeah, it's true that anopa doesn't get that "out of the box", however it's easy enough to get there: one just needs to create a longrun service to process start/stop commands, e.g. have a servicedir aa-command that looks something like: % cat run #!/usr/bin/execlineb -P fdmove -c 2 1 fdmove -c 4 1 fdmove 1 3 s6-ipcserver -1 -- socket s6-ipcserver-access -i rules -- fdmove 2 4 s6-sudod -2 ./aa-command % cat aa-command #!/usr/bin/execlineb -s1 ifelse -n { test $1 = start -o $1 = stop -o =1 = reset } { if { aa-echo -De "Invalid command: $1" } exit 1 } if { aa-echo -Dn +w "Running: " +b "aa-${1} $@" } exec aa-${1} -D $@ And voilĂ ! :) Now to start foobar you'd just do e.g: s6-sudo /run/services/aa-command/socket start foobar And aa-start will run in the same predictable environment. In fact, you could say that's indeed the proper way to do it, and I should add a note about it in the documentation. Thing is, I've always thought of anopa as a set of tools, that allow you to set things up however you want. I like that idea, and so that's why it doesn't create service(dir)s on its own, unlike s6-rc. So I'm not sure I want to include a servicedir for aa-command as described above, bugs me somehow; Just like I know s6-rc has a nice interface to set up a pipe between services, and that's of course doable easily w/ anopa, though "less easily" since you need to provide the e.g. pipe@ & fdholderd servicedirs yourself. OTOH anopa does come with aa-stage{0..4} scripts, that's true. Somehow that doesn't really bother me, even if I also think of those more as examples than anything else (although they're usable as-is w/out issue, I do so myself.) Anyhow, that's how one can use anopa and have it run oneshots with the same reproducible launch guarantees that it runs longruns with. :) Cheers,