🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Programacion de demonios

#15067
From: J.A. Gutierrez
Date: Thu, 24 Aug 2000 00:00
32 lines
1798 bytes
Mario Teijeiro Otero <asimovi@teleline.es> wrote:
:> 
:> int main(int argc, char **argv, char **envp)
:> {
:> 	if (fork())
:> 	{
:> 		exit(0);
:> 	}
:> 
:> 	printf("%d\n",getpid()); 
:> 	sleep( atol( argv[1] ));
:> 	exit(0);
:> }

: esto as� no vale, ya que si cierras el terminal de donde lo lanzaste, el 

	negativo, haz la prueba.
	Al hacer un fork de esa forma, el proceso es heredado por init,
	con lo que el shell ya no le manda el HUP al salir.

: programa tb se sale, es necesario salir de las sesi�n desde el programa, 
: es decir, hace como un nohup. 

	nohup lo que hace, aparte de cerrar los canales de comunicaciones,
	es ignorar la se~nal "HUP"...


-- 
PGP and other useless info at      \                 Oh, show us the way
http://www.cps.unizar.es/~spd/      \             to the next whisky bar
finger://daphne.cps.unizar.es/spd    \                      Weill/Bretch
es doloroso ser sabio y descubrir la sopa de ajo                   (Pla)
Technical Details
Message-ID: <8o34s2$os6$1@news.unizar.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8nr6fh$11h4t11@SGI3651ef0.iddeo.es> <8ntmc3$c1v$2@news.unizar.es> <m3wvh9dnnj.fsf@asimovi.localdomain>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,a5c338c109de3a74
X-Google-Attributes: gidf86c8,public
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Subject: Re: Programacion de demonios
Date: 2000/08/24
Message-ID: <8o34s2$os6$1@news.unizar.es>
X-Deja-AN: 661928896
Content-Transfer-Encoding: 8bit
References: <8nr6fh$11h4t11@SGI3651ef0.iddeo.es> <8ntmc3$c1v$2@news.unizar.es> <m3wvh9dnnj.fsf@asimovi.localdomain>
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: usenet@news.unizar.es
X-Trace: news.unizar.es 967120578 25478 155.210.152.20 (24 Aug 2000 12:36:18 GMT)
Organization: Rank
Mime-Version: 1.0
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (IRIX/6.2 (IP22))
NNTP-Posting-Date: 24 Aug 2000 12:36:18 GMT
Newsgroups: es.comp.os.linux.programacion