🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #216

Re: Jak rozpoznac init?

#216
From: Daniel Mróz
Date: Thu, 09 Sep 1999 21:44
27 lines
2016 bytes
On 9 Sep 1999 12:25:03 GMT, Robert Luberda <robert@pingu.ii.uj.edu.pl> wrote:
>>>Inaczej jeśli getppid()!=1 to na pewno nie przez init
>>>natomiast inaczej nie bardzo wiadomoe
>> Wlasnie :/. Qrde...musi byc jakis sposob...Bede dalej probowal...Dzieki za
>> pomoc.
>W manie  do inita jest napisane, że 
>"Init sets the following environment variables for all its children:
> [...]
>INIT_VERSION
>	[...] Useful to determine if a script runs directly from init."
Qrde...Jak moglem zapomniec o manie do inita?!?!?

>Czyli: 
>if (getppid()==1 && getenv("INIT_VERSION"))
>	printf("_Najprawdopodobniej_ moim ojcem jest init!");
A w jakim przypadku moze byc ustawiona ta zmienna lecz proces nie odpalony z
inita? Czy sytuacja, gdy zmienna jest ustawiona choc nie powinna byc, zdaza sie
czesto?

Pozdrawiam
Beorn

-- 
-------------------------------------------------------------------------------
Daniel 'Beorn' Mróz
beorn@alpha.pl
----------------------------------ooo^..^ooo-----------------------------------
Technical Details
Message-ID: <slrn7tggqv.cr.beorn@cyberdeck.digital.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!orion.cst.tpsa.pl!news.tpnet.pl!not-for-mail
References: <slrn7tdb1r.hr.beorn@cyberdeck.digital.pl> <slrn7te1oa.ti5.kjonca@kjonca.kjonca.bogus> <slrn7tf1ej.h6.beorn@cyberdeck.digital.pl> <7r88uv$6u2$1@info.cyf-kr.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!orion.cst.tpsa.pl!news.tpnet.pl!not-for-mail
From: Daniel Mróz <beorn@cyberdeck.digital.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Re: Jak rozpoznac init?
References: <slrn7tdb1r.hr.beorn@cyberdeck.digital.pl> <slrn7te1oa.ti5.kjonca@kjonca.kjonca.bogus> <slrn7tf1ej.h6.beorn@cyberdeck.digital.pl> <7r88uv$6u2$1@info.cyf-kr.edu.pl>
Organization: *phi* Tak sobie walimy mlotkami d8-/
Reply-To: beorn@alpha.pl
Message-ID: <slrn7tggqv.cr.beorn@cyberdeck.digital.pl>
Mime-Version: 1.0
User-Agent: slrn/0.9.5.4 (UNIX)
Lines: 27
Date: Thu, 09 Sep 1999 21:44:30 GMT
NNTP-Posting-Host: 212.160.55.183
X-Complaints-To: abuse@tpsa.pl
X-Trace: news.tpnet.pl 936913470 212.160.55.183 (Thu, 09 Sep 1999 23:44:30 MET DST)
NNTP-Posting-Date: Thu, 09 Sep 1999 23:44:30 MET DST
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit