On 07/25/2008 05:08 PM, Patrick wrote: > Hello All, > I've read the config file under /etc/slp.conf. > Inside it, there is a section > ;net.slp.watchRegistrationPID = false > > I think this is about the openslp watching on the services (or > process, i.e. sshd, ftpd) in SA. In more detail, slpd will automatically deregister services when the registrating process dies. This only applies to 'runtime' registrations, not 'static' registration in the slp.reg file. > And if the running services is down, or the pid disappears, SA will > know that, and automatically dereg that service out from itself. > Am I right? > > If I'm right. I've traced into the code at ./libslp/Libslp_reg.c in > line 255. > > ****************************************************************************** > > if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.watchRegistrationPID"))) > { > extoffset = curpos - buf; > ToUINT16(curpos,SLP_EXTENSION_ID_REG_PID); > curpos += 2; > ToUINT24(curpos,0); > curpos += 3; > ToUINT32(curpos,SLPPidGet()); > curpos += 4; > } > ****************************************************************************** > It seems that slpd will get the pid of something. Keep in mind that the functions in directory 'libslp' are part of, well, the slp library, and are called by the application that uses it. In this case, the process that does the registration sends its own PID to slpd, so the latter can watch that pid. > Normally, it's its own pid, if I didn't miss something. > I also added an printf after it, like this, > printf("pid is : %d\n",*curpos); > But the output is alway 0. I think *curpos dereferences a char, not the int you are interested in. Try printf("%d", SLPPidGet()) to be sure.
The auto-deregistration functionality works for the trunk version, but if I remember correctly, it didn't work for version 1.2. Looking at the svn history, I believe this was fixed in revision 1513 (2006-04-26). Roel > > I did the same thing before there a little bit, and I can get the > service name. > But the pid is alway 0. > > The problem is, > 1. Does the OpenSLP implement the PID watching? The SLPPidGet seems > only get pid of slpd....... > 2. When the service process disappears, if OpenSLP can know that? > 3. Do I need to notice OpenSLP the pid of a specific service? How to > do....... Or only the name is enough. > > Thanks a lot for any response! > > Best > Patrick & Sha > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Openslp-devel mailing list > Openslp-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openslp-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Openslp-devel mailing list Openslp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openslp-devel