daemonization cannot be done be a shell script - it has to happen
in the executeable.  It is quite easy to do, however:

cd /
fork/exec - parent exits
set sid
close all file descriptors (more of a concern on sysV)
fork/exec - parent exits
syslog all messages

It's also a good idea to add some commandline args to tell it
to not fork/exec and become a daemon and also dump messages to
stdout/stderr instead of syslog.

If you have any questions concerning the above - let me know.

Hmmm.  I guess I'm just as liable telling you how to do it as
writing the code - maybe I'll just write some code . . . I dunno
(stinking munition laws).

"Niels M�ller" wrote:
> 
> Thayne Harbaugh <[EMAIL PROTECTED]> writes:
> 
> > What are the plans to make lshd a real daemon?  I could do it for
> > you, but I'm not sure if the (stinking) US munitions laws care about
> > me writin deamons for encryption or if they only care about encryption
> > itself.
> 
> It's on my TODO list, but not very high on it. I'm not familiar with
> all the details involved in deamonization, but if that is at all
> possible, I think it might be reasonable to let a separate wrapper
> program (or perhaps even a shell script) handle that.
> 
> /Niels

Reply via email to