Hi Patrick,
1. PID watching does work in the current code, although it didn't work in
the old release (1.2.1). We rely on it in our application.
2. Every 15s, the SLP daemon checks that the process that registered a
service still exists (for this to work, a daemon must be running on the
machine where the registration took place)
3. You don't need to specify a PID at any point - the library picks up the
PID of the application doing the registration and automatically includes it
in the registration message, using the code extract you have quoted. The
reason you get 0 from your printf is that the pid is stored as a 32-bit
quantity, and curpos is a pointer to a single-byte quantity so, if you are
on a big-endian machine, *curpos will usually be 0, as most machines' PIDs
are only 16-bit.
-----Original Message-----
From: Patrick [mailto:[EMAIL PROTECTED]
Sent: 25 July 2008 16:08
To: openslp-devel@lists.sourceforge.net
Subject: [Openslp-devel] Does "watchRegistrationPID" work?
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.
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.
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 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 email, including any attachment, is a confidential communication
intended solely for the use of the individual or entity to whom it is
addressed. It contains information which is private and may be proprietary
or covered by legal professional privilege. If you have received this email
in error, please notify the sender upon receipt, and immediately delete it
from your system.
Anything contained in this email that is not connected with the businesses
of this company is neither endorsed by nor is the liability of this company.
Whilst we have taken reasonable precautions to ensure that any attachment to
this email has been swept for viruses, we cannot accept liability for any
damage sustained as a result of software viruses, and would advise that you
carry out your own virus checks before opening any attachment.
-------------------------------------------------------------------------
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