dh, the daemon helper

Discussion in 'C Programming' started by John Kelly, Sep 5, 2009.

  1. John Kelly

    John Kelly Guest

    John Kelly, Sep 5, 2009
    #1
    1. Advertising

  2. John Kelly

    Kaz Kylheku Guest

    On 2009-09-05, John Kelly <> wrote:
    > dh, the daemon helper
    >
    > The daemon helper starts any program or script as a daemon. It's a
    > small C program with a simple interface and a liberal license.


    You can do this nicely with a larger program called "screen".

    Oldie, goodie.

    With screen you can run a program in a detached screen session,
    non-interactively.

    Your program gets a controlling tty, to which you can attach later. Screen
    gives you a virtual console where you can see recent output from the program or
    even review the scrollback history.

    So you don't have to do all that Unix daemonizing crap in your program
    (detaching from a controlling tty, closing stdin and stdout, etc).
    Kaz Kylheku, Sep 5, 2009
    #2
    1. Advertising

  3. On Sep 5, 5:21 am, John Kelly <> wrote:
    > dh, the daemon helper
    >
    > The daemon helper starts any program or script as a daemon.  It's a
    > small C program with a simple interface and a liberal license.
    >
    > ftp://ftp.isp2dial.com/users/jak/src/dh/
    >
    > Get the files and:
    >
    > make install clean
    >
    > There is no man page, but the README explains how to use it.
    >
    > --
    > Webmail for Dialup Usershttp://www.isp2dial.com/freeaccounts.html


    The stuff homeworks are made of.
    Michael Foukarakis, Sep 5, 2009
    #3
  4. John Kelly

    John Kelly Guest

    On Sat, 5 Sep 2009 04:28:19 +0000 (UTC), Kaz Kylheku
    <> wrote:

    >> The daemon helper starts any program or script as a daemon. It's a
    >> small C program with a simple interface and a liberal license.


    >You can do this nicely with a larger program called "screen".


    >So you don't have to do all that Unix daemonizing crap in your program
    >(detaching from a controlling tty, closing stdin and stdout, etc).


    Sometimes I use screen, but it's not always what I want.

    There are other daemon tools too, but I had certain ideas about how one
    should work, so I wrote dh.


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 5, 2009
    #4
  5. John Kelly

    jacob navia Guest

    John Kelly a écrit :
    > On Sat, 5 Sep 2009 04:28:19 +0000 (UTC), Kaz Kylheku
    > <> wrote:
    >
    >>> The daemon helper starts any program or script as a daemon. It's a
    >>> small C program with a simple interface and a liberal license.

    >
    >> You can do this nicely with a larger program called "screen".

    >
    >> So you don't have to do all that Unix daemonizing crap in your program
    >> (detaching from a controlling tty, closing stdin and stdout, etc).

    >
    > Sometimes I use screen, but it's not always what I want.
    >
    > There are other daemon tools too, but I had certain ideas about how one
    > should work, so I wrote dh.
    >
    >


    And you are offering it to the community.

    Thanks.
    jacob navia, Sep 5, 2009
    #5
  6. John Kelly

    John Kelly Guest

    On Sat, 5 Sep 2009 02:48:21 -0700 (PDT), Michael Foukarakis
    <> wrote:

    >> The daemon helper starts any program or script as a daemon.  It's a
    >> small C program with a simple interface and a liberal license.
    >>
    >> ftp://ftp.isp2dial.com/users/jak/src/dh/
    >>
    >> Get the files and:
    >>
    >> make install clean
    >>
    >> There is no man page, but the README explains how to use it.


    >The stuff homeworks are made of.


    Thoughtful criticism can be useful. But maybe it's too much work for a
    troll to read or test the code.


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 5, 2009
    #6
  7. John Kelly

    John Kelly Guest

    On Sat, 05 Sep 2009 13:49:39 +0200, jacob navia <>
    wrote:

    >> The daemon helper starts any program or script as a daemon. It's a
    >> small C program with a simple interface and a liberal license.


    > And you are offering it to the community. Thanks.


    I've been using dh on Linux, but I had some time to waste, and got
    curious about portability. With some minor changes, I compiled and
    installed it on NetBSD 5.0.1 x86. So now it's portable. Wheee!

    It's a cool tool, it reports problems encountered when trying to exec
    the target daemon program or script. Debian's start-stop-deamon can't
    do that, nor can any other daemon tool I know of.

    It's minimal, with only one command line option, -p. Avoiding unneeded
    bells and whistles was my intentional design.

    In six months time, I could lose interest in computers, start a new
    career, and the work would be lost forever. Someone who likes C more
    than I do should adopt dh and help it grow.

    But if you do, don't believe what Stevens wrote about ignoring SIGHUP
    before the second fork(). It's not true, so don't write voodoo code to
    handle it! See the thread in c.u.p with the subject "Orphaned process
    groups, daemon startup, SIGHUP."

    If you can't adopt dh, but have ideas for patches, send them. But if I
    don't respond, well then, you're on your own.

    Get it while it's hot ...

    ftp://ftp.isp2dial.com/users/jak/src/dh/


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #7
  8. John Kelly <> writes:
    > On Sat, 05 Sep 2009 13:49:39 +0200, jacob navia <>
    > wrote:
    >
    >>> The daemon helper starts any program or script as a daemon. It's a
    >>> small C program with a simple interface and a liberal license.

    >
    >> And you are offering it to the community. Thanks.

    >
    > I've been using dh on Linux, but I had some time to waste, and got
    > curious about portability. With some minor changes, I compiled and
    > installed it on NetBSD 5.0.1 x86. So now it's portable. Wheee!

    [...]

    It sounds like it's portable only to Unix-like systems.

    You might consider posting to comp.unix.programmer.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Sep 9, 2009
    #8
  9. John Kelly

    John Kelly Guest

    On Wed, 09 Sep 2009 10:03:48 -0700, Keith Thompson <>
    wrote:

    >> I've been using dh on Linux, but I had some time to waste, and got
    >> curious about portability. With some minor changes, I compiled and
    >> installed it on NetBSD 5.0.1 x86. So now it's portable. Wheee!


    >It sounds like it's portable only to Unix-like systems.


    Probably.


    >You might consider posting to comp.unix.programmer.


    I wonder what systems usage prevails among readers of this ng. Not
    sure, but I am sure this ng has more readers than c.u.p. You know they
    say there's no such thing as bad publicity.

    And those brainiacs over in c.u.p scare me. ;-)


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #9
  10. John Kelly

    jameskuyper Guest

    John Kelly wrote:
    > On Wed, 09 Sep 2009 10:03:48 -0700, Keith Thompson <>
    > wrote:

    ....
    > >You might consider posting to comp.unix.programmer.

    >
    > I wonder what systems usage prevails among readers of this ng. Not
    > sure, but I am sure this ng has more readers than c.u.p. ...


    There are a great many newsgroups that have more readers than c.u.p;
    according to Google the currently most active usenet group is
    alt.suicide.holiday, with 19087 messages per month. that doesn't make
    a.s.h an appropriate places to post messages that are unix-specific.

    > ... You know they
    > say there's no such thing as bad publicity.


    The people who say that are PR types; for the rest of us, all
    publicity that publicizes anything we're not interested in a waste of
    our time.
    jameskuyper, Sep 9, 2009
    #10
  11. John Kelly

    John Kelly Guest

    On Wed, 9 Sep 2009 10:43:33 -0700 (PDT), jameskuyper
    <> wrote:

    >John Kelly wrote:


    >> I wonder what systems usage prevails among readers of this ng. Not
    >> sure, but I am sure this ng has more readers than c.u.p. ...


    >There are a great many newsgroups that have more readers than c.u.p;
    >according to Google the currently most active usenet group is
    >alt.suicide.holiday, with 19087 messages per month. that doesn't make
    >a.s.h an appropriate places to post messages that are unix-specific.


    Well I didn't post to an obviously unrelated ng. Eh?


    >> ... You know they
    >> say there's no such thing as bad publicity.

    >
    >The people who say that are PR types; for the rest of us, all
    >publicity that publicizes anything we're not interested in a waste of
    >our time.


    c.u.p is not limited to C programming. They discuss a variety of unix
    topics. So dh can't be entirely on topic there either.

    dh is written in C. That makes it topical for discussion here. I see
    discussion in this ng less topical than dh. If you're the topic police,
    please apprehend them.


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #11
  12. John Kelly <> writes:
    > On Wed, 9 Sep 2009 10:43:33 -0700 (PDT), jameskuyper
    > <> wrote:

    [...]
    > c.u.p is not limited to C programming. They discuss a variety of unix
    > topics. So dh can't be entirely on topic there either.


    Sure it can. C programming for Unix is one of the "variety of unix
    topics" they discuss there, probably the most important one.

    > dh is written in C. That makes it topical for discussion here. I see
    > discussion in this ng less topical than dh. If you're the topic police,
    > please apprehend them.


    The topicality guidelines for this newsgroup have been determined over
    many years by general consensus of (most of) the regular participants.
    Not everything written in C is considered topical here.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Sep 9, 2009
    #12
  13. John Kelly

    jameskuyper Guest

    John Kelly wrote:
    > On Wed, 9 Sep 2009 10:43:33 -0700 (PDT), jameskuyper
    > <> wrote:
    >
    > >John Kelly wrote:

    >
    > >> I wonder what systems usage prevails among readers of this ng. Not
    > >> sure, but I am sure this ng has more readers than c.u.p. ...

    >
    > >There are a great many newsgroups that have more readers than c.u.p;
    > >according to Google the currently most active usenet group is
    > >alt.suicide.holiday, with 19087 messages per month. that doesn't make
    > >a.s.h an appropriate places to post messages that are unix-specific.

    >
    > Well I didn't post to an obviously unrelated ng. Eh?
    >
    >
    > >> ... You know they
    > >> say there's no such thing as bad publicity.

    > >
    > >The people who say that are PR types; for the rest of us, all
    > >publicity that publicizes anything we're not interested in a waste of
    > >our time.

    >
    > c.u.p is not limited to C programming. They discuss a variety of unix
    > topics. So dh can't be entirely on topic there either.




    > dh is written in C. That makes it topical for discussion here. I see
    > discussion in this ng less topical than dh. If you're the topic police,
    > please apprehend them.


    There's no official charter for this newsgroup, just an out-of-date
    description of what the newsgroup is for that was posted long before
    newsgroups had charters, and before this newsgroup's name was changed
    to it's current one. There's no official topicality rules, and no
    consensus about what they should be. There was a discussion many
    months ago about what the topicality guidelines should be, but
    essentially all of the most vocal critics of the very concept of
    "topicality" refused to participate in any meaningful sense in that
    discussion, so the "consensus" reached by that discussion was not
    really a consensus of the group.

    That is why I prefer to avoid talking about topicality, as such.
    Instead, I prefer to talk about where you can get the best answers to
    questions about specific kinds of topics. For unix specific questions
    about C programming, you'll get better results in a newsgroup devoted
    to Unix than in one devoted to C. That's because most of the more
    complicated issues that such code can raise tend to be unix-specific
    rather than C-specific. Also, most Unix programmers are at least
    somewhat knowlegeable about C; a large fraction of the C programmers
    not at all familiar with Unix.
    jameskuyper, Sep 9, 2009
    #13
  14. John Kelly

    John Kelly Guest

    On Wed, 09 Sep 2009 11:32:08 -0700, Keith Thompson <>
    wrote:

    >> c.u.p is not limited to C programming. They discuss a variety of unix
    >> topics. So dh can't be entirely on topic there either.


    >C programming for Unix is one of the "variety of unix topics" they
    >discuss there, probably the most important one.


    If you're a spokesman for c.u.p, I'll tell them you sent me. Then maybe
    they won't bite.


    >The topicality guidelines for this newsgroup have been determined over
    >many years by general consensus of (most of) the regular participants.
    >Not everything written in C is considered topical here.


    A vocal minority of regulars may claim consensus without submitting a
    vote to the general population. google groups says:


    > comp.lang.c
    > Discussion about C.
    > 13833 members


    That's a lot of readers. I think it's best to ignore threads you're not
    interested in. Every time I reply, people see my subject again ...


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #14
  15. John Kelly

    John Kelly Guest

    On Wed, 9 Sep 2009 11:58:26 -0700 (PDT), jameskuyper
    <> wrote:

    >That is why I prefer to avoid talking about topicality, as such.
    >Instead, I prefer to talk about where you can get the best answers to
    >questions about specific kinds of topics. For unix specific questions
    >about C programming, you'll get better results in a newsgroup devoted
    >to Unix than in one devoted to C. That's because most of the more
    >complicated issues that such code can raise tend to be unix-specific
    >rather than C-specific. Also, most Unix programmers are at least
    >somewhat knowlegeable about C; a large fraction of the C programmers
    >not at all familiar with Unix.


    I hear you.

    But I want extra publicity for dh. There's no money in it for me. I
    just want dh to keep living after I'm gone. So I'm not going to beat it
    to death before I go ...


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #15
  16. John Kelly

    jameskuyper Guest

    John Kelly wrote:
    > On Wed, 09 Sep 2009 11:32:08 -0700, Keith Thompson <>
    > wrote:

    ....
    > > comp.lang.c
    > > Discussion about C.
    > > 13833 members

    >
    > That's a lot of readers. I think it's best to ignore threads you're not
    > interested in. Every time I reply, people see my subject again ...


    By far the easiest and least time-consuming way to ignore threads
    you're not interested in is to not subscribe to newsgroups where such
    threads would be on-topic. Your approach to newsgroup topicality makes
    that approach to ignoring threads ineffective.
    jameskuyper, Sep 9, 2009
    #16
  17. John Kelly <> writes:
    > On Wed, 09 Sep 2009 11:32:08 -0700, Keith Thompson <>
    > wrote:
    >
    >>> c.u.p is not limited to C programming. They discuss a variety of unix
    >>> topics. So dh can't be entirely on topic there either.

    >
    >>C programming for Unix is one of the "variety of unix topics" they
    >>discuss there, probably the most important one.

    >
    > If you're a spokesman for c.u.p, I'll tell them you sent me. Then maybe
    > they won't bite.


    I am not a spokesman for any newsgroup. Unmoderated newsgroups don't
    have spokesmen.

    Why are you concerned about them biting you? Aside from the
    obvious point that biting is not physically possible over Usenet,
    c.u.p is generally not an unfriendly newsgroup. If you post there,
    you'll probably get some combination of intelligent discussion,
    constructive criticism, flaming, and trolling; you'll probably get
    less of the latter there than you would here.

    [snip]

    You've written a program that's specific to Unix. Several people
    have told you that comp.unix.programmer is probably the best place
    to discuss it. Why are you so resistant to the idea?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Sep 9, 2009
    #17
  18. John Kelly

    John Kelly Guest

    On Wed, 09 Sep 2009 12:39:45 -0700, Keith Thompson <>
    wrote:

    >You've written a program that's specific to Unix. Several people
    >have told you that comp.unix.programmer is probably the best place
    >to discuss it. Why are you so resistant to the idea?


    Some time ago, I posted dh there. I learned from the thread, and since
    then, I've made significant improvements to dh.

    I'm just a worker who likes to build things. I'm not as smart as they
    are. But maybe I can return.


    --
    Webmail for Dialup Users
    http://www.isp2dial.com/freeaccounts.html
    John Kelly, Sep 9, 2009
    #18
  19. John Kelly

    jacob navia Guest

    John Kelly a écrit :
    > On Wed, 09 Sep 2009 12:39:45 -0700, Keith Thompson <>
    > wrote:
    >
    >> You've written a program that's specific to Unix. Several people
    >> have told you that comp.unix.programmer is probably the best place
    >> to discuss it. Why are you so resistant to the idea?

    >
    > Some time ago, I posted dh there. I learned from the thread, and since
    > then, I've made significant improvements to dh.
    >
    > I'm just a worker who likes to build things. I'm not as smart as they
    > are. But maybe I can return.
    >
    >


    This is correct. Do not pay attention to the trolls.

    You contributed something and people can learn from you.
    jacob navia, Sep 9, 2009
    #19
  20. John Kelly

    Seebs Guest

    Re: dh, the buggy and insecure daemon helper that doesn't do any good

    On 2009-09-11, John Kelly <> wrote:
    > dh is topical. It's written in C.


    The topic of this group is not "programs which happen to have been implemented
    in C" but "C programming".

    If you can't grasp this distinction, I think it safe to assume that your code
    is pretty poor too, and that anything you are advertising this way is probably
    of negative value.

    -s
    --
    Copyright 2009, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
    Seebs, Sep 11, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Re: dh, the daemon helper

    , Nov 2, 2008, in forum: C Programming
    Replies:
    5
    Views:
    307
    James Kuyper
    Nov 3, 2008
  2. John Kelly

    ANN: dh, the daemon helper

    John Kelly, Sep 10, 2009, in forum: Python
    Replies:
    2
    Views:
    294
    John Kelly
    Sep 10, 2009
  3. John Kelly

    dh, the daemon helper 2009-09-11

    John Kelly, Sep 12, 2009, in forum: C Programming
    Replies:
    3
    Views:
    292
    Seebs
    Sep 14, 2009
  4. John Kelly

    ANN: dh, the daemon helper 2009-09-12 11:11

    John Kelly, Sep 12, 2009, in forum: C Programming
    Replies:
    1
    Views:
    280
    Seebs
    Sep 12, 2009
  5. kevin
    Replies:
    1
    Views:
    359
    Kairi Zikpin
    Jul 21, 2006
Loading...

Share This Page