Feature requests for execline & s6

From: Olivier Brunel <jjk_at_jjacky.com>
Date: Mon, 26 Jan 2015 19:02:48 +0100

Hi Laurent,

A couple things I'd like to ask, on different tools :

- execline: I'd like the addition of a new command, e.g. readvar, that
would allow to read the content/first line of a file into a variable.
IOW, something similar to importas (including an optional default
value), only instead of specifying an environment variable one would
give a file name to load the value from (in a similar manner as to what
s6-envdir does, only for one var/file and w/out actually using
environment variable).
This would be pretty useful for e.g. using options in scripts.

- s6-log: I think a new action to write to a file could be useful.
Specifically, what I need done is have some actions occur on certain log
events. I'm thinking that if the logging script in s6-log could write
the selected lines to a file, said file could actually be a FIFO where a
supervised app would be listenning/processing what's written there as
needed.
This seems to me like it'd be a good solution, but s6-log doesn't
provide a way to do that, unless I'm missing something. I can't use
status file because they're done atomically, i.e. a new file is written
and renamed, and I don't want the whole logdir mechanics of rotation,
etc Just simply writing lines to a file.
Unless you recommend a better way to accomplish what I'm trying to do?

- Minor thing, but just to make sure I didn't misunderstand something
really: in s6_svstatus_{read,write} you have code like the following:

char tmp[n + 2 + sizeof(S6_SVSTATUS_FILENAME)] ;
byte_copy(tmp, n, dir) ;
byte_copy(tmp + n, 2 + sizeof(S6_SVSTATUS_FILENAME), "/"
S6_SVSTATUS_FILENAME) ;

Now, shouldn't thoose 2 simply be 1-s, since the NUL is already
accounted for with sizeof? Or am I missing/misunderstanding something here?

Regards,
-j
Received on Mon Jan 26 2015 - 18:02:48 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC