[2019-08-30 02:11] Lorenzo Puliti <lorenzo.r...@gmail.com>
> > But before patch can be submitted to maintainer, automatic testing is
> > must. I suggest salsa.debian.org/kaction/daemons.
>
> Is there any instruction on how to use it?

Sure. Here is how I did it for Tor:

https://salsa.debian.org/kaction/tor-runscript/commit/460ad44c8046fd91baf053b44ec6ce3d5215753d

Key point is this line in .gitlab-ci.yml:

        include:
          - https://salsa.debian.org/kaction/daemons/raw/master/pipeline.yml

So you import package on Salsa (or just fork, but Tor does not use
Salsa), add CI, add runscript and tweak it until `daemons` job pass.

Note of warning: tests are run in Docker, not in full virtual machine,
so at least netlink sockets do not work. Maybe you will discover some
other limitations :)

Albeit non-ideal, this CI caught my stupid error, when I forgot to
create /run/tor in runscript, because it worked on my box.

> >> Do I need to 'set -e' in run script, or it's inherited from invoke-run?
> > No, it is not. Do you think invoke-run should?
> Mmm, I don't have an strong opinion on that, I think it's fine as it is now.

Okay. Let's leave it as-is.

> > * please do not print "Starting $NAME". It goes to log, quite
> >   pointless and may confuse scripts/tools that want to analyze log.
>
> I know it goes to log, that was exactly my idea but i didn't thought about
> scripts that want to analyze logs.
> Runit is absolutely mute and in some case it's hard for me to understand
> what is wrong with a service. For example, if in the log there is no
> `Starting NAME` message i know something is wrong with the run file;
> if i see a stream of `starting NAME Stopping NAME` i know there is 
> some permanent failure condition. I'm not sure I will be able to help in
> solving bug that users will send about runit services without those
> markers. Maybe I can change the message into something less confusing
> like `runsv: starting NAME` and `runsv: NAME stopped` ?

I have two ideas:

 * Check for $VERBOSE variable. If you have issues with services {foo},
   you can

    # mkdir -p /etc/sv/foo/conf
    # echo 1 > /et/sv/foo/conf/VERBOSE

 * You can write to /dev/tty63 (or some other unused tty). It is hard to
   copy-paste from there, though.

Either way, 'runsv:' is improvement, imho.

> > PS. You know that I already got runscript into src:tor and src:acpid?
>
> yes I've noticed that :) 
> I've send a couple of patches too and have few others
> ready (but those need the fix for #934173).
> Maybe you can help with Anacron? It's QA maintained.
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934231

I am fine doing QA upload, but can you please add CI test?

Also, I am worried about runscripts being so repetive. We already know
historic study case: classic init.d scripts and init-d-script(5).

At minimum, I think we need something like 'invoke-finish' in bin:runit
and dh_runit to create one-line `finish` script by default.  Variable
'NAME' should be exported by `invoke-run'.
-- 
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.

Reply via email to