[26180] in Perl-Users-Digest
Perl-Users Digest, Issue: 8369 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 30 00:05:51 2005
Date: Mon, 29 Aug 2005 21:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 29 Aug 2005 Volume: 10 Number: 8369
Today's topics:
Re: Dealing with signup bots with a Perl CGI script <ron@savage.net.au>
Re: can't rebind placehodler - Blob, ODBC, SQL Server, <eric@afaik.us>
Dealing With Zombies in a Daemon <hal@thresholddigital.com>
Re: Dealing With Zombies in a Daemon xhoster@gmail.com
Re: Jargons of Info Tech industry <albalmer@att.net>
Re: Jargons of Info Tech industry <john@castleamber.com>
Re: Wrote a eBayAPI perl module, how to release it to C <glex_no-spam@qwest-spam-no.invalid>
Re: Wrote a eBayAPI perl module, how to release it to C <john@castleamber.com>
Re: Wrote a eBayAPI perl module, how to release it to C <ignoramus23186@NOSPAM.23186.invalid>
Re: Wrote a eBayAPI perl module, how to release it to C <john@castleamber.com>
Re: Wrote a eBayAPI perl module, how to release it to C <jgibson@mail.arc.nasa.gov>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Aug 2005 08:43:56 +1000
From: Ron Savage <ron@savage.net.au>
Subject: Re: Dealing with signup bots with a Perl CGI script
Message-Id: <200583084356.381866@ron>
On Mon, 29 Aug 2005 17:30:29 +1000, Joe wrote:
Hi Joe
Besides Brian's good answer, search the mail archives of the=
CGI::Application
mailing list. This topic has been discussed over the last couple of weeks.
------------------------------
Date: Mon, 29 Aug 2005 20:34:00 -0400
From: Eric Anderson <eric@afaik.us>
Subject: Re: can't rebind placehodler - Blob, ODBC, SQL Server, DBI, Win32
Message-Id: <1125362062.b8a4b543a092c076df4e379bf618340f@teranews>
Mark Clements wrote:
> Have you tried binding as different types eg
>
> SQL_BINARY
> SQL_VARBINARY
>
> what is the actual datatype of the field in question ie "Data" (which
> isn't a very descriptive name :) )?
Yes, I have tried all sorts of types. The actual type is an image field
type which is basically SQL Server talk for "large blob". I finally used
the shortcut syntax ($stmt->bind_param(1, $self->data(),
SQL_LONGVARBINARY);) and it worked. Who knows the issue. there are so
many layers in this setup (DBI unixODBC, FreeTDS, SQL server) who knows
who's fault it is. I'm just glad I got it working.
Thanks for trying,
Eric
------------------------------
Date: Mon, 29 Aug 2005 20:05:30 -0400
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Dealing With Zombies in a Daemon
Message-Id: <HJGdnYDVYcVVP47eRVn-oQ@comcast.com>
I have a Perl program that runs as a daemon, with a specified loop, doing
certain things at certain seconds of the minute (like at 5 seconds after
the start of the minute it runs one set of routines, 20 seconds later
another set, and 30 seconds after that, another set, sleeping between each
set of routines). At the end of the minute, I have it reaping any zombies
that have been created. One thing it does is launch programs. To do this,
I fork() and run the program with backticks around the program name. For
some reason, after I've launched a program, if I call the reaper() routine
(below) before the launched program is done, the daemon will freeze in
reaper() until the launched program finishes.
So here's a few questions:
1) Do the unreaped zombies actually take up memory space, or just a number
in the list of PIDs?
2) I understand I can reap by setting $SIG{CHLD} to IGNORE, is that by just
using an assignment ($SIG{CHLD} = IGNORE), and how well does it work? The
name makes me think it just ignores zombies without doing anything.
3) Am I doing something wrong in the routines below, or is there a better
way to do this?
4) Why is the program hanging and waiting for the program that is still
running?
Thanks!
Hal
Subroutines:
#In the start, I have:
use POSIX ":sys_wait_h";
our $zombies = 0;
$SIG{CHLD} = sub{ $zombies++ };
Then I have a routine I call at the end of each loop the daemon makes:
sub reaper {
my (%Kid_Status)
if ($zombies) {
print "Zombie count: $zombie\n";
while (($zombie = waitpid(-1, WNOHANG)) != -1) {
$Kid_Status{$zombie} = $?;
}
}
return;
}
------------------------------
Date: 30 Aug 2005 01:31:35 GMT
From: xhoster@gmail.com
Subject: Re: Dealing With Zombies in a Daemon
Message-Id: <20050829213135.347$Qn@newsreader.com>
Hal Vaughan <hal@thresholddigital.com> wrote:
> For some reason, after I've launched a program, if I call
> the reaper() routine (below) before the launched program is done, the
> daemon will freeze in reaper() until the launched program finishes.
>
> So here's a few questions:
>
> 1) Do the unreaped zombies actually take up memory space, or just a
> number in the list of PIDs?
Yes, they take up space. Even just numbers in a list are still taking up
space. And not just any space, but space in a very important, finite
kernel memory structure.
> 2) I understand I can reap by setting $SIG{CHLD} to IGNORE, is that by
> just using an assignment ($SIG{CHLD} = IGNORE), and how well does it
You need quotes around IGNORE.
> work? The name makes me think it just ignores zombies without doing
> anything.
In my experience, it works very well. I don't know exactly what you think
"just ignoring zombies without doing anything" means, so I don't know if
you are right. Obviously, this does something different than what not
setting SIG{CHLD} to IGNORE does.
3) Am I doing something wrong in the routines below, or is
> there a better way to do this?
Yes, you are doing something wrong.
> 4) Why is the program hanging and waiting for the program that is still
> running?
If waitpid returns a zero meaning that children exist but are not ready for
reaping, which it is documented to do on some systems, then your code
enters a tight loop. Rather, do,
while (($zombie = waitpid(-1, WNOHANG)) <= 0) {
>
>
> sub reaper {
> my (%Kid_Status)
What is the point of making a hash that never does anything useful?
Also, that is a syntax error.
> if ($zombies) {
> print "Zombie count: $zombie\n";
> while (($zombie = waitpid(-1, WNOHANG)) != -1) {
> $Kid_Status{$zombie} = $?;
> }
> }
> return;
> }
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 29 Aug 2005 16:01:15 -0700
From: Alan Balmer <albalmer@att.net>
Subject: Re: Jargons of Info Tech industry
Message-Id: <4t47h15at19osfqbic87v4p39hp6jtn2nc@4ax.com>
On 29 Aug 2005 21:12:13 GMT, John Bokma <john@castleamber.com> wrote:
>> Now, go away. And please, stay away.
>
>Like I already said, it doesn't work that way.
Goodbye, John. Filters set.
--
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net
------------------------------
Date: 30 Aug 2005 02:15:41 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Jargons of Info Tech industry
Message-Id: <Xns96C1D8480DF1Ecastleamber@130.133.1.4>
Alan Balmer <albalmer@att.net> wrote:
> On 29 Aug 2005 21:12:13 GMT, John Bokma <john@castleamber.com> wrote:
>
>>> Now, go away. And please, stay away.
>>
>>Like I already said, it doesn't work that way.
>
> Goodbye, John. Filters set.
Saidly you didn't get the message. Moreover you think that the Usenet
/needs/ a public ploink message. Get a clue. People like you add more noise
to Usenet compared to a thread which runs a bit wide.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Mon, 29 Aug 2005 17:09:59 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Wrote a eBayAPI perl module, how to release it to CPAN?
Message-Id: <XILQe.13$IN.3257@news.uswest.net>
Ignoramus23186 wrote:
> Okay, so, let's say I will call it Net::eBay. Fine with me.
>
> How do I make it into a nice CPAN distro?
Start with the FAQ, on CPAN.
http://cpan.org/misc/cpan-faq.html
ExtUtils::MakeMaker is your friend. :-)
------------------------------
Date: 30 Aug 2005 01:32:32 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Wrote a eBayAPI perl module, how to release it to CPAN?
Message-Id: <Xns96C1D0F76809castleamber@130.133.1.4>
Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
> On 29 Aug 2005 21:22:01 GMT, John Bokma <john@castleamber.com> wrote:
[ snip ]
>> I don't want to discuss if the Net name is a good one, only that I
>> would expect an Net::eBay, not an XML::eBayAPI. That is uses XML
>> doesn't matter, a module should be an abstraction. Also, that it's an
>> API is clear :-)
>
> Okay, so, let's say I will call it Net::eBay. Fine with me.
I see now and then module naming questions pop up in
comp.lang.perl.modules, so maybe it's a good place to ask there.
> How do I make it into a nice CPAN distro?
<http://cpan.org/misc/cpan-faq.html#How_contribute_modules>
I seem to remember that h2xs has an option to make a directory structure
and the necessary initial files which is often used to make CPAN distros.
(I.e. the README, INSTALL, etc. Note that you have to edit several of those
files)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Tue, 30 Aug 2005 01:56:16 GMT
From: Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid>
Subject: Re: Wrote a eBayAPI perl module, how to release it to CPAN?
Message-Id: <41PQe.110808$f24.52815@fe18.usenetserver.com>
On 30 Aug 2005 01:32:32 GMT, John Bokma <john@castleamber.com> wrote:
> Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
>
>> On 29 Aug 2005 21:22:01 GMT, John Bokma <john@castleamber.com> wrote:
>
> [ snip ]
>
>>> I don't want to discuss if the Net name is a good one, only that I
>>> would expect an Net::eBay, not an XML::eBayAPI. That is uses XML
>>> doesn't matter, a module should be an abstraction. Also, that it's an
>>> API is clear :-)
>>
>> Okay, so, let's say I will call it Net::eBay. Fine with me.
>
> I see now and then module naming questions pop up in
> comp.lang.perl.modules, so maybe it's a good place to ask there.
>
>> How do I make it into a nice CPAN distro?
>
><http://cpan.org/misc/cpan-faq.html#How_contribute_modules>
>
> I seem to remember that h2xs has an option to make a directory structure
> and the necessary initial files which is often used to make CPAN distros.
> (I.e. the README, INSTALL, etc. Note that you have to edit several of those
> files)
>
What I recall is that there is a super nice system for making
Makefile.PL and whatnot, make test etc. Unfortunately, I forgot the
name of that system.
i
--
------------------------------
Date: 30 Aug 2005 02:19:08 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Wrote a eBayAPI perl module, how to release it to CPAN?
Message-Id: <Xns96C1D8DDC704Acastleamber@130.133.1.4>
Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
> On 30 Aug 2005 01:32:32 GMT, John Bokma <john@castleamber.com> wrote:
>> Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
>>
>>> On 29 Aug 2005 21:22:01 GMT, John Bokma <john@castleamber.com>
>>> wrote:
[..]
>> I seem to remember that h2xs has an option to make a directory
>> structure and the necessary initial files which is often used to make
>> CPAN distros. (I.e. the README, INSTALL, etc. Note that you have to
>> edit several of those files)
>
> What I recall is that there is a super nice system for making
> Makefile.PL and whatnot, make test etc. Unfortunately, I forgot the
> name of that system.
h2xs? And yeah, it's easy to forget :-)
However: <http://www.platypiventures.com/perl/present/tpc5modules/001.html>
So forget it again (and I have bookmarked that page, so thanks :-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Mon, 29 Aug 2005 19:24:40 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Wrote a eBayAPI perl module, how to release it to CPAN?
Message-Id: <290820051924403963%jgibson@mail.arc.nasa.gov>
In article <41PQe.110808$f24.52815@fe18.usenetserver.com>,
Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
> On 30 Aug 2005 01:32:32 GMT, John Bokma <john@castleamber.com> wrote:
> > Ignoramus23186 <ignoramus23186@NOSPAM.23186.invalid> wrote:
> >
> >> On 29 Aug 2005 21:22:01 GMT, John Bokma <john@castleamber.com> wrote:
> >
[snip]
> >
> >> How do I make it into a nice CPAN distro?
> >
> ><http://cpan.org/misc/cpan-faq.html#How_contribute_modules>
> >
> > I seem to remember that h2xs has an option to make a directory structure
> > and the necessary initial files which is often used to make CPAN distros.
> > (I.e. the README, INSTALL, etc. Note that you have to edit several of those
> > files)
> >
>
> What I recall is that there is a super nice system for making
> Makefile.PL and whatnot, make test etc. Unfortunately, I forgot the
> name of that system.
See 'perldoc perlnewmod' and 'perldoc module-starter' for information
on the module-starter utility.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8369
***************************************