thanks for submitting this bug fix but i'm not sure what problem it solves. the code that you have submitted below would not close all file descriptor after fork but rather would only close 0,1 and 2 (stdin,stdout,stderr). are you saying that kvm_read() passed data over a file descriptor? if so, i think the right solution is to run daemon_init() BEFORE we run metric_init(). in the past, we ran metric_init() first because some operating system required that gmond initialize as root (before it setuid to another user e.g. "nobody").
i'm CC:ing the developers to double check but i'm pretty sure we don't need gmond to start as root anymore. if i don't here objections from the other developers, i'm going to solve this problem by forking/setuid BEFORE metric_init in order that the kvm_read descriptor doesn't get closed (assuming that is the problem). thanks again for the feedback... it's really appreciated. -matt Sanghyun Hong wrote: > Hi, John > > The follow problem was solved to modify some source > code. I think that file descriptor has been used some > thread during close function, but I don't understand > this problem. because, daemon routine execute after > thread-creation routine... > > > lib/daemon_init.c > > ... > > umask (0); /* clear our file mode > creation mask */ > > /* you must comment this for-loop > for (i = 0; i < MAXFD; i++) > close (i); > */ > > /* only close about standard I/O > for (i = 0; i <= 2; i++) > close (i); > > Thanks, > Sanghyun > > --- John Saalwaechter <[EMAIL PROTECTED]> wrote: > > >>Thanks for tracing down the details. A couple of >>previous posts related to >>this (but with no answers): >> >> > > http://sourceforge.net/mailarchive/message.php?msg_id=9423342 > > http://sourceforge.net/mailarchive/message.php?msg_id=9622256 > >>--- Sanghyun Hong <[EMAIL PROTECTED]> wrote: >> >> >>>Hi everyone >>> >>>I'm running gmond v2.5.6 on Solaris8/SPARK and it >> >>was >> >>>compiled gcc 3.3.2. >>>When I execute it on daemon mode, it always fail. >>>But, on debug mode, normally executes. >>> >>>I trace the relevant code fragment >> >>(gmond/machine.c). >> >>>If gmond is a deamon mode, kvm_read() has failed >> >>and >> >>>exit(23). >>>Debug msg is that, >>> "gmond: kvm_read for cpu: Transport endpoint is >> >>not >> >>>connected" >>> >>>Anyone else have any ideas? >>> >>> >>>int >>>getkval (unsigned long offset, >>> int *ptr, >>> int size, >>> char *refstr) >>>{ >>> if (kvm_read (kd, offset, (char *) ptr, size) != >>>size) >>> { >>> debug_msg("There was a problem! I'll try >> >>to >> >>>reload."); >>> kvm_close(kd); >>> kd = kvm_open (NULL, NULL, NULL, O_RDONLY, >>>NULL); >>> >>> if (*refstr == '!') >>> { >>> debug_msg("*refstr == ! : gmond: >> >>kvm_read >> >>>for %s: %s", >>> refstr, strerror(errno)); >>> return (1); >>> } >>> else >>> { >>> debug_msg ("gmond: kvm_read for %s: %s", >>>refstr, strerror(errno)); >>> exit (23); <-- On daemon mode, has >> >>failed >> >>>($gmond) >>> } >>> } <-- On debug mode, normally executes ($gmond >>>-d1) >>>} >>> >>>Thanks, >>>Sanghyun >>> >>>__________________________________________________ >>>Do You Yahoo!? >>>Tired of spam? Yahoo! Mail has the best spam >> >>protection around >> >>>http://mail.yahoo.com >>> >>> >>> >> > ------------------------------------------------------- > >>>SF email is sponsored by - The IT Product Guide >>>Read honest & candid reviews on hundreds of IT >> >>Products from real users. >> >>>Discover which products truly live up to the hype. >> >>Start reading now. >> >>>http://productguide.itmanagersjournal.com/ >>>_______________________________________________ >>>Ganglia-general mailing list >>>[EMAIL PROTECTED] >>> >> > https://lists.sourceforge.net/lists/listinfo/ganglia-general > >> >>__________________________________________________ >>Do You Yahoo!? >>Tired of spam? Yahoo! Mail has the best spam >>protection around >>http://mail.yahoo.com >> > > > > > > > > ___________________________________ > 최대 100MB, 더 이상 용량 고민없는 - 야후! 메일 (http://mail.yahoo.co.kr) > 최신곡, 추천곡, 가요, OST, 팝송, 뮤직비디오 - 야후! 비트박스 (http://kr.music.yahoo.com) > 최신 휴대폰 정보, 벨소리, 캐릭터, 문자메세지 - 야후! 모바일 (http://kr.mobile.yahoo.com) > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Ganglia-general mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/ganglia-general -- PGP fingerprint 'A7C2 3C2F 8445 AD3C 135E F40B 242A 5984 ACBC 91D3' They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. --Benjamin Franklin, Historical Review of Pennsylvania, 1759
signature.asc
Description: OpenPGP digital signature