Hi Patrick,

Patrick Kristiansen wrote on Tue, Jan 28, 2020 at 09:29:20AM +0100:

> But another use for daemon(8) is for its ability to detach the child
> process from the controlling terminal and furthermore redirect its
> stdout/stderr to syslog. Is there some mechanism to do that from the
> shell? Perhaps a combination of nohup and starting a background job?

That doesn't strike me as a particularly bright idea either.

Properly starting up a daemon process requires several steps,
often involving unveil(2), pledge(2), chroot(2), prviledge
dropping, sometimes fork+exec for privilege separation,
and so on.  Typically, these steps need to be intermixed in
exactly the right order with option parsing, environment
parsing, parsing of configuration files and various kinds
of initialization.

Writing wrappers usually just doesn't work, and it seems doubtful
to me whether daemon(8) is up to what is usually needed.

Some sh(1) code quickly hacked together may be good enough for
testing purposes, but i doubt that you want to use such a hack
for a real daemon that you are planning to run in production on 
the Internet.

Yours,
  Ingo

Reply via email to