🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #15069

Re: Programacion de demonios

#15069
From: Salvador Petit Mart�
Date: Thu, 24 Aug 2000 00:00
58 lines
2849 bytes
Guido Reina <guido.reina@tecnet-sports.com> wrote:
> Hola.
>     Me gustaria saber como se programa un demonio que se pueda lanzar desde
> un terminal, se quede residente, y se mantenga funcionando aunque se mate al
> terminal. Que se independice del terminal.
> Osea, como lo que hacen el apache, el samba, etc.

> Muchas Gracias.

De "man 4 tty":

TTY(4)              Linux Programmer's Manual              TTY(4)


NAME
       tty - controlling terminal

DESCRIPTION
       The  file /dev/tty is a character file with major number 5
       and minor number 0, usually of mode 0666  and  owner.group
       root.tty.  It is a synonym for the controlling terminal of
       a process, if any.

       In addition to  the  ioctl()  requests  supported  by  the
       device  that  tty refers to, the following ioctl() request
       is supported:

       TIOCNOTTY
              Detach the current  process  from  its  controlling
              terminal,  and  remove  it from its current process
              group, without attaching it to a new process  group
              (that  is, set its process group ID to zero).  This
              ioctl() call only works on  file  descriptors  con�
              nected  to  /dev/tty;  this  is used by daemon pro�
              cesses when they are invoked by a user at a  termi�
              nal.  The process attempts to open /dev/tty; if the
              open succeeds, it detaches itself from the terminal
              by  using TIOCNOTTY, while if the open fails, it is
              obviously not attached to a terminal and  does  not
              need to detach itself.

FILES
       /dev/tty

SEE ALSO
       mknod(1),   chown(1),  getty(1),  termios(2),  console(4),
       ttys(4)



--
           @@@@@@@@@@ 
          @@        @@  
         @@   @@@@@  @@           .         .
 spetit  @@  @@  @@  @@   disca  ...  upv  ...  es  
         @@   @@@@@@@@            .         .
          @@           @@
           @@@@@@@@@@@@@           
Technical Details
Message-ID: <8o37iq$buj$1@polaris.cc.upv.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8nr6fh$11h4t11@SGI3651ef0.iddeo.es>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,a5c338c109de3a74
X-Google-Attributes: gidf86c8,public
From: Salvador Petit Mart� <mr.smith@matrix.com>
Subject: Re: Programacion de demonios
Date: 2000/08/24
Message-ID: <8o37iq$buj$1@polaris.cc.upv.es>
X-Deja-AN: 661950255
Content-Transfer-Encoding: 8bit
References: <8nr6fh$11h4t11@SGI3651ef0.iddeo.es>
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: newsmaster@upv.es
X-Trace: polaris.cc.upv.es 967123354 12243 158.42.50.92 (24 Aug 2000 13:22:34 GMT)
Organization: DISCA - Universidad Polit�cnica de Valencia
Mime-Version: 1.0
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (Linux/2.2.13 (i686))
NNTP-Posting-Date: 24 Aug 2000 13:22:34 GMT
Newsgroups: es.comp.os.linux.programacion