Re: On the feasibility of a shell that includes execline features

2017-04-12 Thread Casper Ti. Vector
tified. [2] <https://scsh.net/docu/html/man-Z-H-2.html#node_chap_1>. On Sun, Aug 21, 2016 at 11:00:43PM +0800, Casper Ti. Vector wrote: > What do we need > --- > > Unfortunately, I am not a system programmer, and do not my current time > schedule allow me to spend en

Re: On possibly "finer" dependencies in s6-rc

2017-02-14 Thread Casper Ti. Vector
What about a `dnsmasq' service depending on serveral `dnscrypt-proxy' instances for failover, and can start when any of the instances become ready? On Tue, Sep 29, 2015 at 06:00:40PM +0200, Laurent Bercot wrote: > On a theoretical level, I tend to agree; and I will definitely > think about handl

Re: [PATCH] supervise: set down&ready (D) even on LASTFINISH

2017-01-28 Thread Casper Ti. Vector
Seems that the patch uses 4-space tabs while skaware uses 2-space tabs, and that discrepancy was not addressed when the patch was applied... On Sat, Jan 28, 2017 at 02:15:31PM +, Laurent Bercot wrote: > Applied, thanks! -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.

Re: s6 talk at FOSDEM 2017

2017-01-05 Thread Casper Ti. Vector
Now I see. Thanks :) On Thu, Jan 05, 2017 at 10:59:28AM +, Laurent Bercot wrote: > Please bear in mind that I did not intend these slides to be published > as is, I only linked them to show FOSDEM organizers that there was > material to work with - and they ended up on the public event page

Re: s6 talk at FOSDEM 2017

2017-01-04 Thread Casper Ti. Vector
* p. 12: after skimming inittab(5), I am inclined to agree that the time to start `respawn' processes are undocumented. But I do not think they are started in parallel with `wait' processes: whether on Gentoo or Alpine, I always find gettys to be started after `openrc default'. * pp. 40-41:

Re: Adding capability control into the `run' script comparison page

2016-12-05 Thread Casper Ti. Vector
Many thanks :) On Tue, Dec 06, 2016 at 12:53:14AM +, Jonathan de Boyne Pollard wrote: > * http://jdebp.eu./Softwares/nosh/guide.html -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19) 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C

Re: Adding capability control into the `run' script comparison page

2016-12-05 Thread Casper Ti. Vector
Sorry, my fault. I read the page in a hurry, and thought the page did not contain ulimit when the reply said capability control was not involved in your page. Impatience is really a sin :( Nevertheless, if you do plan to create a separate page for cgroup support, I think a brief introduction of

Adding capability control into the `run' script comparison page

2016-12-03 Thread Casper Ti. Vector
nosh's `run' script comparison page [1] is a very excellent refutation against the "non-systemd init scripts are full of boilerplate" argument. Nevertheless, one systemd supporter argues [2] that the page is not representative for the "advanced" features, including service dependency and capability

Re: How to trap ctrl-alt-del?

2016-12-01 Thread Casper Ti. Vector
Setting `kernel.ctrl-alt-del' to 0 just makes C-A-D send SIGINT to PID 1 (instead of triggering a hard reboot). If you want to make SIGINT trigger a grace shutdown, you can modify the SIGINT handler in the `service/.s6-svscan' directory. But I personally do not think changing signal semantics (wh

Re: How to trap ctrl-alt-del?

2016-11-29 Thread Casper Ti. Vector
Yes, now it works :) On Tue, Nov 29, 2016 at 10:05:14AM +, Laurent Bercot wrote: > Should be fixed now. -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19) 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C

Re: How to trap ctrl-alt-del?

2016-11-28 Thread Casper Ti. Vector
The mail archive (archive.cgi) seems to be still down. The git interface (cgit.cgi) is working though... On Fri, Nov 25, 2016 at 04:26:55PM +0800, Casper Ti. Vector wrote: > The second is an alternative link in case the server returns an empty > reply, which is happening to me: > > &

Re: How to trap ctrl-alt-del?

2016-11-26 Thread Casper Ti. Vector
Try s6-linux-init [1]; you can modify the scripts in the `.s6-svscan' directory according to your requirements. [1] . On Sat, Nov 26, 2016 at 03:10:32PM +0300, Jean Louis wrote: > Now I wonder how to practically implement the -s option, should I just >

Re: How to trap ctrl-alt-del?

2016-11-25 Thread Casper Ti. Vector
On Fri, Nov 25, 2016 at 11:07:15AM +0300, Jean Louis wrote: > How may I trap ctrl-alt-del, $ sysctl kernel.ctrl-alt-del=0 > and assign a function to it, so that system nicely shuts down?

Re: Using both clocks in s6-log and friends?

2016-10-29 Thread Casper Ti. Vector
I see. This is very understandable. On Sat, Oct 29, 2016 at 03:39:41PM +, Laurent Bercot wrote: > I'm not sure whether the benefits of handling the special case of > booting a machine that doesn't know the time yet (so will require one > time jump at some point) are enough to balance the inco

Using both clocks in s6-log and friends?

2016-10-29 Thread Casper Ti. Vector
While the requirement for timestamping and the internal implementation of skalibs favours the wall clock [1][2], I think it does not preclude programs from using the monotonic clock solely for internal timekeeping, which might make the clock skew issues less serious. Any comments? (Just asking in

Re: On the feasibility of a shell that includes execline features

2016-08-22 Thread Casper Ti. Vector
This is a valid and important point; but I do think the arguments in the `dieshdiedie' (well the name...) page are, though incisive wrt sh(1), mostly unfair to the shell language. I understand your pursuit of simplicity in the implementation, and agree that the overhead is unavoidable; but let's a

Re: s6-linux-init: SIGUSR1 and SIGUSR2

2016-08-22 Thread Casper Ti. Vector
Are SIGUSR1 and SIGUSR2 not just silently ignored in -S mode? On Mon, Aug 22, 2016 at 12:15:59PM +0200, Laurent Bercot wrote: > If you really think it's worth it to swap SIGUSR1 and SIGUSR2, I'll do > it. (I'd change the non-diverted meanings in s6-svscan, so that they > remain in sync with the di

Re: On the feasibility of a shell that includes execline features

2016-08-21 Thread Casper Ti. Vector
Please forgive my gross carelessness :( On Sun, Aug 21, 2016 at 11:00:43PM +0800, Casper Ti. Vector wrote: > > $ for i in $(seq 500); do loopwhilex /bin/true /bin/true & done > > $ for i in $(seq 100); do rc -c 'while (/bin/true) /bin/true' & done > and &g

Re: On the feasibility of a shell that includes execline features

2016-08-21 Thread Casper Ti. Vector
On Sun, Aug 21, 2016 at 11:00:43PM +0800, Casper Ti. Vector wrote: > simple and clear (i.e. not kludgy) shell scripts To make it clear: "kludgy" is meant in comparison with other shell scripts, not execline scripts. > # Think of `redirfd -w /dev/null'. ... should obviously

Re: On the feasibility of a shell that includes execline features

2016-08-21 Thread Casper Ti. Vector
Always forgetting something :| This time the attachment... On Sun, Aug 21, 2016 at 11:00:43PM +0800, Casper Ti. Vector wrote: > Attached is a simplified tarball of the config of my Alpine server, plus > instructions for the setup -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (e

On the feasibility of a shell that includes execline features

2016-08-21 Thread Casper Ti. Vector
Introduction In [1], I (probably after many other people with similar ideas) came up with the idea of a "language that somehow combines execline-like chainloading and shell-like sequential execution". [1]

Re: s6-linux-init: SIGUSR1 and SIGUSR2

2016-08-21 Thread Casper Ti. Vector
Well... That's understandable :| On Sun, Aug 21, 2016 at 11:15:44AM +0200, Laurent Bercot wrote: > Well, by the point I remembered to make the change, I already had > systems depending on the old behaviour :/ > > So, all in all, I don't think I'll swap the default meaning after all. > It's p

s6-linux-init: SIGUSR1 and SIGUSR2

2016-08-20 Thread Casper Ti. Vector
It seems that the exchanging of SIGUSR1 and SIGUSR2 [1] in s6-linux-init did not happen. Is it just forgotten, or ...? [1] . -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19) 707

Re: s6-rc: output of ./finish not directed to logger?

2016-08-19 Thread Casper Ti. Vector
It works now. Thanks :) On Fri, Aug 19, 2016 at 01:16:10PM +0200, Laurent Bercot wrote: > Should be fixed in the latest git. -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19) 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C

Re: s6-rc: output of ./finish not directed to logger?

2016-08-19 Thread Casper Ti. Vector
Latest version of s6-rc in the git repo creates a `./finish' wrapper even when `./finish' does not exist, leading to errors: > $ ls /run/service/some.service > event finish runrun.user supervise Another bug caused by asymmetry in specification :( By the way, I think s6's `servic

Re: s6-rc: output of ./finish not directed to logger?

2016-08-18 Thread Casper Ti. Vector
:) On Thu, Aug 18, 2016 at 05:15:16PM +0200, Laurent Bercot wrote: > That's... an oversight, because all the infrastructure to make it work > is already there. Thanks for the report - I'll add the missing pieces to > the compiler as soon as possible. :) -- My current OpenPGP key: RSA4096/0x227

s6-rc: output of ./finish not directed to logger?

2016-08-18 Thread Casper Ti. Vector
I found that, with the current behaviour of s6-rc, the output of `./finish' is not redirected to the logger process: > $ ls /run/service/some.service > data event finish runrun.user supervise Is this a design decision? If not, I think it would be really nice (and, hopefu

Re: Catch-all logger stops catching logs, and is not restarted after SIGKILL

2016-08-15 Thread Casper Ti. Vector
I see :) On Mon, Aug 15, 2016 at 08:47:26PM +0200, Laurent Bercot wrote: > Ah, yes, I've had that one, and it's really difficult to fix in s6-log, > because by definition an application that timestamps needs "wall clock" > time, not "stopwatch" time. > > 5 If your machine does not have a CMOS

Re: Catch-all logger stops catching logs, and is not restarted after SIGKILL

2016-08-15 Thread Casper Ti. Vector
Found the culprit: a clock skew due to incorrect options in invocation of hwclock(8). Not sure whether it will be worth trying to work around such PEBKAC from the s6 / s6-rc side :| On Mon, Aug 15, 2016 at 11:39:48PM +0800, Casper Ti. Vector wrote: > On an Alpine Linux system managed using

Re: Catch-all logger stops catching logs, and is not restarted after SIGKILL

2016-08-15 Thread Casper Ti. Vector
On Mon, Aug 15, 2016 at 07:08:09PM +0200, Laurent Bercot wrote: > 1. Would you happen, by any chance, to have a longrun, in your service > database, named s6-svscan-log? If you do, rename that service to something > else: it conflicts with the catch-all logger that is managed by s6 but not > bys6

Catch-all logger stops catching logs, and is not restarted after SIGKILL

2016-08-15 Thread Casper Ti. Vector
On an Alpine Linux system managed using s6 (2.3.0.0) / s6-rc (0.0.3.0) with a fairly complex service set, if the following commands # echo @@ > /run/service/s6-svscan-log/fifo # tail /run/uncaught-logs/current are inserted before `s6-rc -u change blahblah' in the stage2 script, a corresponding

Re: Equivalence of bundles and no-op oneshots in s6-rc

2016-08-14 Thread Casper Ti. Vector
Many thanks for the clarification. Now I (kind of) understand the difference :) [Resending again due to forgotten list-reply; will use the following command to reduce the probability of this happening again: $ printf 'bind index r list-reply\nbind index L reply\n' >> ~/.muttrc] On Sun, Aug 14, 20

Equivalence of bundles and no-op oneshots in s6-rc

2016-08-14 Thread Casper Ti. Vector
Theoretically, a bundle just acts like a oneshot that does nothing but pulling in dependencies (contents of the bundle). If this is actually the case, is it possible to just make the `./up' for oneshots optional (`./down' is already optional), and make `bundle' and `./contents' aliases of `oneshot

Re: Things related to a lecture on s6/s6-rc (suggestions welcome)

2016-03-13 Thread Casper Ti. Vector
Thanks for your kind words :) On Sun, Mar 13, 2016 at 12:10:28PM +0100, Laurent Bercot wrote: > I'm sure you did great, and I thank you a lot for going through with this. > I really appreciate it. (Also, control of lecture length comes with practice, > so don't fret about it - just do more of th

Re: Things related to a lecture on s6/s6-rc (suggestions welcome)

2016-03-12 Thread Casper Ti. Vector
Forgotten attachment -.- On Sun, Mar 13, 2016 at 02:38:25PM +0800, Casper Ti. Vector wrote: > The lecture was given last evening, and was fairly successful (mainly > except for low-level things I do not understand well and details I am > not sufficiently familiar with, and an exceedingly

Re: Things related to a lecture on s6/s6-rc (suggestions welcome)

2016-03-12 Thread Casper Ti. Vector
rvices (except for ucspilogd and kmsg) do not have dedicated loggers, and the logs are all stored in tmps just like the catch-all logger. (This paragraph is mostly equivalent to what I mean for the "Coarseness of logging setup in the example" in the outline). On Sun, Feb 21, 2016 at 10:06:22PM

Re: Things related to a lecture on s6/s6-rc (suggestions welcome)

2016-02-21 Thread Casper Ti. Vector
On Sun, Feb 21, 2016 at 08:34:59PM +0100, Laurent Bercot wrote: > That's awesome! thanks for spreading the good word :) Many thanks for your appreciation then :) > I would offer to proofread your slides, if you have any, but if > you're giving the lecture in Chinese, my help would be very lim

Things related to a lecture on s6/s6-rc (suggestions welcome)

2016-02-21 Thread Casper Ti. Vector
Hello, I plan to give a 2-hour student-to-students lecture about s6/s6-rc in my school's LUG. Attached are related files for anyone interested (any suggestion is more than welcome): * Init-RC-with-s6.txt: the outline I prepared for the lecture. (The outline is base on a my personal view of s6/s

Re: Holidays Brainstorming: instanced supervision

2016-01-18 Thread Casper Ti. Vector
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 >

Re: Some random thoughts on s6 and execline...

2015-12-25 Thread Casper Ti. Vector
I see. Thanks :) On Fri, Dec 25, 2015 at 08:52:04PM +0100, Laurent Bercot wrote: > I should do it at some point indeed. > I'm reluctant to document all of it. -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19) 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C

Re: Some random thoughts on s6 and execline...

2015-12-25 Thread Casper Ti. Vector
It's neat! I've really not thought of this. Many thanks. On Fri, Dec 25, 2015 at 09:02:12PM +0100, Laurent Bercot wrote: > While I'm at it, here's the procedure to safely restart a > s6-fdholder-daemon: > > 1. Start up another, temporary, s6-fdholder-daemon > 2. s6-fdholder-transferdump

Some random thoughts on s6 and execline...

2015-12-25 Thread Casper Ti. Vector
* s6-ipcserver was moved from s6-networking to s6, but `s6:doc/ucspilogd.html' still refers to `s6-ipcserver' with a link to ; similarly, `s6:doc/s6-log.html' talks about "combined with the s6-networking package". * s6, s6-rc and

Re: Combining logs in daemontools-like frameworks?

2015-11-09 Thread Casper Ti. Vector
I was complete unaware of this property... Thanks very much then :) On Mon, Nov 09, 2015 at 05:08:10PM +0100, Laurent Bercot wrote: > Unix guarantees that writes to pipes are atomic up to PIPE_BUF > characters. So, if your services only write full lines at a time, > only lines will be interleav

Re: Combining logs in daemontools-like frameworks?

2015-11-09 Thread Casper Ti. Vector
I also considered the fifo method, but it appears that logs from different sources might be interleaved on the character level (for example, with `...' lines from source A and `...' lines from source B you might end up with `aabaabbb...' in the combined log) if no correct scheduling is done

Combining logs in daemontools-like frameworks?

2015-11-09 Thread Casper Ti. Vector
Suppose there are several services, and I want their log (complete or only those fulfilling certain conditions) to be combined, for example in the following scenarios: * Those services are low-volumed (eg. getty's). * Some important part of these logs are combined to allow a sysadmin to have a q

Re: On possibly "finer" dependencies in s6-rc

2015-09-29 Thread Casper Ti. Vector
[Just accidentally sent as private mail; reposting verbatim.] I'm glad that possibility still exists. Thanks :) On Tue, Sep 29, 2015 at 06:00:40PM +0200, Laurent Bercot wrote: > I just compromised here in the name of practicality. It's definitely > a possibility of evolution for s6-rc if it beco

Re: On possibly "finer" dependencies in s6-rc

2015-09-29 Thread Casper Ti. Vector
Sorry, but please allow me to append my previously forgotten conclusion: "Make it simple, but not over-simple". On Tue, Sep 29, 2015 at 10:28:30PM +0800, Casper Ti. Vector wrote: > Sorry again for my possibly irritating language. Hope these make sense. -- My current OpenP

Re: On possibly "finer" dependencies in s6-rc

2015-09-29 Thread Casper Ti. Vector
I see. I agree that the typical use case of this feature is almost limited to the `eth0'/`wlan0' scenario and cannot think of any other concrete use case that is compelling. Nevertheless, I still think this make s6-rc "incomplete" mechanism-wise (sorry if that appears like insulting): opportunist

Re: On possibly "finer" dependencies in s6-rc

2015-09-29 Thread Casper Ti. Vector
On Tue, Sep 29, 2015 at 09:29:23PM +0800, Casper Ti. Vector wrote: > tr -s ' ' '\n' | grep -xF "$2" | cat "$1" - Should be: tr -s ' ' '\n' | grep -xFf "$2" | cat "$1" - -- My current OpenPGP key: 4096R/0xE18262B5D9BF213A (expires: 2017.1.1) D69C 1828 2BF2 755D C383 D7B2 E182 62B5 D9BF 213A

Re: On possibly "finer" dependencies in s6-rc

2015-09-29 Thread Casper Ti. Vector
On Tue, Sep 29, 2015 at 10:46:02AM +0800, Casper Ti. Vector wrote: > * "opportunist" dependencies: After some more thought, I found one may as well supply a `mandatory' and `opportunist' file for each service, and write a preprocessor program to auto-generate the `depend

On possibly "finer" dependencies in s6-rc

2015-09-28 Thread Casper Ti. Vector
* "opportunist" dependencies: According to `s6-rc:src/s6-rc/s6-rc-compile.c' as of current trunk, unknown services in `dependencies' will make rc-compile complain and die, which is the optimal behaviour with mandatory dependencies. Nevertheless, I think it can be helpful to also support

Re: Some suggestions about s6 and s6-rc

2015-09-20 Thread Casper Ti. Vector
'/`down' (in oneshots currently). (I must be really having a bad day today :() On Sun, Sep 20, 2015 at 03:15:52PM +0800, Casper Ti. Vector wrote: > The same reason explains why I think `up'/`down' are worse names: > because `run'/`finish' (in longruns) and `up&

Re: Some suggestions about s6 and s6-rc

2015-09-20 Thread Casper Ti. Vector
(Accidentally sent to Colin as private mail, reposting verbatim here; sorry for the disturbance...) Well, this naming issue is all about overloading... To circumvent the overloading problem, we can also use some other name pairs like `start'/`stop' or `begin'/`end' (Gentoo and LaTeX user here ;).

Re: Some suggestions about s6 and s6-rc

2015-09-19 Thread Casper Ti. Vector
I just read your modification on the blurb page (commit e56e1294), and found it somehow still lacking: in my experience, dependency is honoured by OpenRC even with `rc_parallel' enabled; and more than that, "readiness" (here defined as `exit 0' for a runscript) is also honoured: > % head /etc/init

Re: Some suggestions about s6 and s6-rc

2015-09-19 Thread Casper Ti. Vector
Since s6-rc is still unreleased, perhaps we can still take the chance to rename `up'/`down' in oneshots to `run'/`finish', in order to let them look a little more unified? On Sun, Sep 20, 2015 at 12:33:28AM +0200, Laurent Bercot wrote: > I agree that the name collision is confusing, and it is an

Re: Some suggestions about s6 and s6-rc

2015-09-19 Thread Casper Ti. Vector
Allow me to clarify myself: what I proposed is to *also* allow oneshots which have a `down' file but no `up' file. But again, the choice is not up to me, so I stop here... On Sat, Sep 19, 2015 at 01:03:32PM -0300, Guillermo wrote: > have an explicit start(). Being forced to always do 'touch down;

Re: Some suggestions about s6 and s6-rc

2015-09-19 Thread Casper Ti. Vector
On Sat, Sep 19, 2015 at 02:26:44PM +0200, Laurent Bercot wrote: > You can't add parallel service start/stop as an afterthought. It has to > be included in the design. OpenRC is a good serial rc system, but it's > not a parallel rc system by any means. Thanks for your explanation, it is very clea

Some suggestions about s6 and s6-rc

2015-09-19 Thread Casper Ti. Vector
Since it has been public that Laurent schedules the release of s6-rc in September 2015, I think it will be beneficial to try to rip the related documentation of factual errors (I keep imagining how Rachel Carson and her friends tried to eliminate flaws in "Silent Spring"). Here are my own findings

Re: [announce] s6-2.1.0.0

2015-06-14 Thread Casper Ti. Vector
at 11:46:27PM +0800, Casper Ti. Vector wrote: > And a little further on the tangent (since I think it is not quite worth > subscribing to the `skaware' list just to post a single message; also > please ignore this if the following have already been considered): I > know about (unre

Re: [announce] s6-2.1.0.0

2015-01-28 Thread Casper Ti. Vector
Though (as always) I'm no expert in this, I fell really urged to second the recommendation on learning more about Plan 9. It's *awesome* both in design and implementation: unlike LP software which appear nice in mind but suck in reality, Plan 9 is practically proved well-thought product, and truly

Re: s6 and friends 2.0

2014-12-28 Thread Casper Ti. Vector
Thanks, I see. I did not do the research due to some time constraints :( On Sun, Dec 28, 2014 at 02:29:03PM +0100, Laurent Bercot wrote: > ${DESTDIR} is different, it's just for staging. The skarnet.org build > process supports DESTDIR, and Portage should have no problem there: leave > --prefix

Re: s6 and friends 2.0

2014-12-28 Thread Casper Ti. Vector
Seconded. This can help a lot with sandboxed building. For example, Gentoo Portage often make use of ${DESTDIR} in the install phase: files are "install"ed to /var/tmp/portage/blah/blah/ and then merged into ${EPREFIX} (which usually means `/'), and do some Gentoo-specific post-processing (inter-

Re: About the nosh package

2014-10-18 Thread Casper Ti. Vector
Sorry if this is too off-topic, but I cannot figure out a reliable way to contact the author of nosh [1], so I put it here in the hope that the author may notice this: diff -ur nosh-1.9/source/recordio.cpp nosh-1.9/source/recordio.cpp --- nosh-1.9/source/recordio.cpp2013-09-12 16:31:50.000

Re: About the nosh package

2014-10-05 Thread Casper Ti. Vector
On Sun, Oct 05, 2014 at 01:06:34PM +0100, Laurent Bercot wrote: > Very interesting. I knew about nosh, but last time I checked it, it > was not developed as much. The systemd unit file offline converter, in > particular, looks promising. > I will definitely have to study how it's made. Jonathan

About the nosh package

2014-10-04 Thread Casper Ti. Vector
Hello list. As some of you possibly know, there is one another sysvinit replacement, which is indeed quite competent - the nosh package [1]. [1] . I consider everyone in this list more of an expert than me in init an

<    1   2