supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Re: Installing dnscache with runit, without other djb utils
@ 2008-07-19  6:02 lanek
  0 siblings, 0 replies; 12+ messages in thread
From: lanek @ 2008-07-19  6:02 UTC (permalink / raw)
  To: supervision

> there's an error here worth highlighting given the "recently discovered"
> issues with DNS query port randomisation.

Detail the error please.

From my [modified] rc.S:

1)

# -- ** initialize /dev/urandom:
_POOLSIZE=/proc/sys/kernel/random/poolsize
_SEED=/etc/random-seed
_URANDOM=/dev/urandom

if [ -f $_SEED ]; then # -- carry an entropy pool (improve randomness).
    yellow "using $_SEED to initialize $_URANDOM ..."
    cat $_SEED > $_URANDOM
fi

if [ ! -r $_POOLSIZE ]; then
    _BYTES=512
else
    _BYTES=`cat $_POOLSIZE`
fi
dd if=$_URANDOM of=$_SEED count=1 bs=$_BYTES 2> /dev/null
chmod 600 $_SEED


(And similarly/complementarily, ditto within rc.6.)

Then from rc.M:

2)

yellow 'starting runit ...' ;   # -- runit "stage 2."
csh -cf 'runsvdir-start &'


Cheers,

/Roy

--
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS   berat sama dipikul, ringan sama dijinjing
SSSSS . s l a c k w a r e  SSSSSS       heavy we shoulder together, light
SSSSS +------------ linux  SSSSSS            we hand-carry together
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS



^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Installing dnscache with runit, without other djb utils
@ 2008-07-19 18:15 lanek
  0 siblings, 0 replies; 12+ messages in thread
From: lanek @ 2008-07-19 18:15 UTC (permalink / raw)
  To: supervision; +Cc: Charlie Brady

> What more detail are you looking for?
>
> The seed file is only useful if it is attached to standard input of the
> dnscache process, which will read up to 128 bytes to seed its RNG.

    [d]nscache reads a seed, up to 128 bytes, from standard input, and passes
    the seed to dns_random_init^1

Yes, dnscache reading the seed from _standard input_ details better the
situation:

    exec<seed or dnscache <seed

become more intelligible. ("If it's a cow don't call it a bovine," says
Ledgard.)

Thank you _very much_ for the vital correction, I don't know how I have
missed
that ... eventually it has been, if I remember correctly, a mere mapping
operation--from daemontools to runit ... And was thinking you were hinting at
some synchronization problems.

/Roy Lanek

     1. Configuration, http://cr.yp.to/djbdns/dnscache.html

--
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS   malu bertanya, sesat di jalan
SSSSS . s l a c k w a r e  SSSSSS   embarrassed to ask will result in
SSSSS +------------ linux  SSSSSS   getting lost
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS



^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <49351.125.162.61.255.1216395759.squirrel@novenine.com>]
* Re: Installing dnscache with runit, without other djb utils
@ 2006-09-28  0:12 Roy Lanek
  2008-07-18 14:20 ` Charlie Brady
  0 siblings, 1 reply; 12+ messages in thread
From: Roy Lanek @ 2006-09-28  0:12 UTC (permalink / raw)


** Sorry for answering late

> I'd like to install djb's dnscache to run under my
> existing runit-based system.

** you can (it's working perfectly for me).

> In order to do so, it seems to require me to install
> a number of other djb utilities which have the same
> name as some of the runit-based symlinks: setuidgid,
> pgrphack, etc.

** no. My case:

/etc/dnscache
    with the usual inner structure (log, supervise, run) +

        /etc/dnscache/env
        /etc/dnscache/root
        /etc/dnscache/seed

    extra

env, root, seed like with the original dnscache
log and supervise like usual

drwxr-sr-x 2 root root   8 Jun 19 02:34 env
drwxr-x--- 3 root xxx    5 Jun 19 02:27 log
drwxr-sr-x 4 root root   4 Jun 19 02:21 root
-rwx------ 1 root root 395 Jun 19 14:51 run
-rw------- 1 root root 128 Sep 28 02:39 seed
drwx------ 2 root root   8 Sep 28 02:39 supervise

xxx is your groupid of choice from the runit family

run is:

#!/bin/sh
exec 2>&1
cd '/etc/dnscache' || exit 1

# -- seed:
umask 077
/bin/rm -f seed
/bin/dd if=/dev/urandom bs=128 count=1 > seed 2> /dev/null
    # -- "Linux has a good source of random data, use 128
    # -- bytes of it to pass it to 'dns_random_init' (via
    # -- 'seed')."^1

exec chpst -U yyy -e ./env -o 250 -d "$DATALIMIT" \
        /usr/bin/dnscache


# -- 1. The dnscache-conf program, djbdns' doc.



with yyy = your userid for dnscache (from the passwd)


run in supervise is:

#!/bin/sh
exec chpst -uxxx svlogd -tt main/dnscache

with xxx the same as above
and main as known. 


symbolic link to /etc/dnscache as usual


Hope I have given you enough info.

The only exception I know in which I had to really compile
daemontools--just to extract tai64n and tai64nlocal--is
uschedule, which I also use with great satisfaction under
runit. (You need also to set a bit up an environment, a
trivial task).

Cheers,

/Roy

P.S.

After a second thought, maybe it interests others too (I
have answered to the sender directly already).
-- 
########################     anjing menggonggong, kafilah tetap berlalu  
##### . slackware ######     the dogs are barking, the caravan moves on  
##### +-----linux ######  [illustrates useless protest, critic, or sarcasm] 
########################


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Installing dnscache with runit, without other djb utils
@ 2006-09-20 22:30 Lloyd Zusman
  2006-09-20 23:49 ` Wayne Marshall
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Lloyd Zusman @ 2006-09-20 22:30 UTC (permalink / raw)


I'd like to install djb's dnscache to run under my existing runit-based
system.  In order to do so, it seems to require me to install a number
of other djb utilities which have the same name as some of the
runit-based symlinks: setuidgid, pgrphack, etc.

This will cause a conflict or worse (overwriting?) with the
corresponding runit-based symlinks, and I want to avoid this.  Does
anyone know how to install dnscache to run under runit _without_ having
djb's utilities mess up my runit-based symlinks?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-07-19 18:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-19  6:02 Installing dnscache with runit, without other djb utils lanek
  -- strict thread matches above, loose matches on Subject: below --
2008-07-19 18:15 lanek
     [not found] <49351.125.162.61.255.1216395759.squirrel@novenine.com>
2008-07-19 16:24 ` Charlie Brady
2006-09-28  0:12 Roy Lanek
2008-07-18 14:20 ` Charlie Brady
2006-09-20 22:30 Lloyd Zusman
2006-09-20 23:49 ` Wayne Marshall
2006-09-21  0:07 ` Vincent Danen
2006-09-21  0:12 ` Charlie Brady
2006-09-21  0:44   ` Lloyd Zusman
2006-09-21  1:03     ` Charlie Brady
2006-09-21  1:28       ` Lloyd Zusman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).