Sorry if this message is nothing except for mechanism and implementation
details, but here's my Gentoo-esque way of doing this with vanilla
s6/execline and a Bourne shell:
> % ls -R
> .:
> data finish run type
>
> ./data:
> conf
> % head type run finish data/conf
> ==> type <==
> longrun
>
> ==> run <==
> #!/usr/local/bin/execlineb -P
> fdmove -c 2 1
> ./data/conf
> s6-envdir -I ./env
> import GETTY
> import -s ARGS
> import TTY
> import -D 38400 BAUD_RATE
> import -sD linux TERM_NAME
> emptyenv -p
> ${GETTY} ${ARGS} ${TTY} ${BAUD_RATE} ${TERM_NAME}
>
> ==> finish <==
> #!/usr/local/bin/execlineb -P
> s6-envdir -I ./env
> backtick -i SVC_NAME { sh -c "echo -n \"${PWD##*.}\"" }
> import -u SVC_NAME
> import -uD ${SVC_NAME} TTY
> utmpset -w ${TTY}
>
> ==> data/conf <==
> #!/bin/sh -
> SVC_NAME="${PWD##*/}"
> GETTY="${SVC_NAME%%.*}"
> TTY="${SVC_NAME##*.}"
> [ x"$TTY" = x"tty1" ] && ARGS='--noclear'
> export GETTY TTY ARGS
> exec "$_at_"
<OT>
The dependency on sh is solely for its syntatic sugar. I admit that the
roles of the languages look weird: perhaps writing the main program in
sh and use execline's tools for the final exec would make the code more
legible.
However, to import the variables from env/ into sh for manipulation, one
again needs to decorate the `/bin/sh' with `s6-envdir -I ./env'. In my
opinion, to simplify such hoop-jumping, one might need another language
that somehow combines execline-like chainloading and shell-like
sequential execution.
Oh, and if a really neat model for shell is needed, I humbly recommend
the rc shell [1] (and Plan 9 in general as a tremendously rich lode of
ingenious ideas related to OS-related research). Hopefully it
will not make Laurent "run away screaming" ;)
[1] <
http://doc.cat-v.org/plan_9/4th_edition/papers/rc>.
(You might notice the style similarity to the darknedgy blog -- yes,
they both use werc, a web ("anti-")framework written in rc; no php /
no ruby on rails / python / etc in core code, just a neatly designed
shell and Unix-ish tools.)
</OT>
On Fri, Dec 25, 2015 at 11:43:31AM +0100, Laurent Bercot wrote:
> Hello everyone, and happy holidays!
>
> In the past few years, there have been some bits and pieces of
> discussion about "instanced services", i.e. some kind of supervised
> service that would be able to create different instances of the
> process at will. But it never got very detailed.
>
> I'd like to ask you: if you feel that instanced services are
> useful, what functionality would you like to see ? Concretely,
> practically, what do you want to be able to do ?
>
> Please stay away from mechanism and implementation details;
> I'm just trying to get a very high-level, conceptual feel for it
> at the moment - "what", as opposed to "how".
--
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
Received on Mon Jan 18 2016 - 13:09:25 UTC