Re: How do I daemonize a process?



Jose-Marcio Martins da Cruz wrote:
Simon 'corecode' Schubert wrote:
Garrett Cooper wrote:
Garrett Cooper wrote:
As the subject suggests I'm trying to determine how I can daemonize a C process, outside of using the rc infrastructure, so that it won't exit when the TTY exists. Does anyone know any quick references or examples?



I suggest daemon(3) if it doesn't have to be portable.

Or something like this, if it has to be portable or if you don't want
to modify C code :

nohup /pathto/c-application &

You'll eventually need to add things like redirect stdout to /dev/null...



Ok, many thanks for the suggestions all :). I'm more than happy not to do the double fork(2) solution =\..
-Garrett
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: How do I daemonize a process?
    ... a C process, outside of using the rc infrastructure, so that it won't ... exit when the TTY exists. ... Does anyone know any quick references or examples? ...
    (freebsd-hackers)
  • Re: How do I daemonize a process?
    ... daemonize a C process, outside of using the rc infrastructure, so that it won't exit when the TTY exists. ...
    (freebsd-hackers)
  • Re: How do I daemonize a process?
    ... daemonize a C process, outside of using the rc infrastructure, so ... that it won't exit when the TTY exists. ...
    (freebsd-hackers)
  • Re: How do I daemonize a process?
    ... a C process, outside of using the rc infrastructure, so that it won't exit when the TTY exists. ... Does anyone know any quick references or examples? ...
    (freebsd-hackers)
  • How do I daemonize a process?
    ... As the subject suggests I'm trying to determine how I can daemonize a C process, outside of using the rc infrastructure, so that it won't exit when the TTY exists. ... Does anyone know any quick references or examples? ...
    (freebsd-hackers)