supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Laurent Bercot <ska-supervision@skarnet.org>
Subject: Re: new "sv status" flags and exit-tracking patch, and misc.
Date: Sat, 17 Sep 2005 10:53:10 +0200	[thread overview]
Message-ID: <20050917085309.GA14841@skarnet.org> (raw)
In-Reply-To: <dgg734$tm7$1@sea.gmane.org>

 I can't address all the points you're raising, but some bits I can answer:


> Why does runit use its own env_get() method rather than getenv()? [This 
> is just one example; there are *lots* of places where C library calls 
> are eschewed in favor of locally-implemented bits].
>
> (...)
> 
> Why define the same error methods and macros at the top of each file (as 
> with fail/failx/warn/warnx/etc)?
> 
> (...)
> 
> Why the huge number of distinct error handling functions and macros with 
> large numbers of parameters instead of just one or two functions using 
> varargs?

 This, my friend, is DJB-style coding. And strange as it may seem to the
profane, it's intentional. :)
 That coding style has its own reasons. All of which are of course
questionable, but at least, asking yourself questions is better than
blindly following a poor standard. If you like runit, then you're already
questioning System V or BSD init ; delving into runit's code is the next
step on the Path to Enlightenment, questioning more of your UNIX habits.
 Take a deep breath, coder, for what thou art about to see may change
your way of thinking forever.

 No, I'm not exaggerating. Well... maybe just a little bit. :)
 Anyway.

 The main points are:

  - when the standard is mediocre, don't follow it. Create a better
standard.

  - libc standards are often mediocre. UNIX is old, and bears the marks
of age (read: compatibility), but back then, good interface design wasn't
a science yet. Example of a deep-rooted legacy interface: stdio.

  - always wonder how something is implemented. Never forget library
overhead; having a nifty does-it-all function call available does not
mean it's a good idea to call it, because it may do way much more than
you need, and be a pain security-wise or performance-wise.

  - libc portability is a myth. When you want portable code, write
portable code, instead of relying on so-called portable functions that
will obscurely break on some architecture in situations you cannot guess
or control. Always play it safe.

 The strerr functions you're talking about are precisely _designed_
to avoid using varargs. The question is not "why not use varargs ?" -
the question is "why would I use varargs when I can do without them ?" :)

 If you want to dive in this "alternatively written software", take a
look at DJB's software, where it all comes from; especially daemontools
(which was the original inspiration for runit) and ucspi-tcp.

 That way of thinking has led to qmail instead of sendmail; djbdns instead
of BIND; tcprules instead of tcp_wrappers; runit instead of System V init;
runwhen instead of cron; ucspi-ssl instead of stunnel; execline instead
of sh (shameless and counterproductive plug here).
 And if nobody has yet come to write a working DJB-style news server to
replace that INN horror, it's because it's a huge amount of painful work
and we all have a life (sort of).

 That was my rant of the year. Time to go back to sleep.

-- 
 Laurent


  parent reply	other threads:[~2005-09-17  8:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-17  4:46 Charles Duffy
2005-09-17  5:17 ` Mike Bell
2005-09-19  8:35   ` Gerrit Pape
2005-09-17  8:53 ` Laurent Bercot [this message]
2005-09-19  8:31 ` Gerrit Pape
2005-09-19 16:04   ` Charles Duffy
2005-09-19 19:13     ` Charles Duffy
2005-09-21 21:50       ` new "sv status" flags and exit-tracking patch, yet again Charles Duffy
2005-09-26 10:12       ` new "sv status" flags and exit-tracking patch, and misc Gerrit Pape
2005-09-26 15:31         ` duplicate processes Jussi Ramo
2005-09-26 15:42           ` Charlie Brady
2005-12-08 11:08         ` new "sv status" flags and exit-tracking patch, and misc Gerrit Pape
2005-12-08 19:37           ` Charles Duffy
2005-12-09 14:29             ` Gerrit Pape
2005-12-09 14:50               ` Rafal Bisingier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050917085309.GA14841@skarnet.org \
    --to=ska-supervision@skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).